import matplotlib.pyplot as plt
fig = plt.figure("Histogram")
ax = fig.add_subplot(1,1,1)
ax.hist([10,10,10,10,10,21,12,23,35,45,60,33,22,56,34,28,40,41],bins=7,ec='black',color = 'b')
plt.title("Distribution")
plt.xlabel("Range")
plt.ylabel("Amount")
plt.show()
this is the simple program to make a histogram My question is if I remove plt from
plt.title("Distribution")
plt.xlabel("Range")
plt.ylabel("Amount")
plt.show()
And rewrite my code like this
ax.set_title("Distribution")
ax.set_xlabel("Range")
ax.set_ylabel("Amount")
plt.show()
Why are both of the versions same?
What are the difference between functions xlabel and set_xlabel/ylabel and set_ylabel