I'm making a histogram in matplotlib and the text label for each bin are overlapping on each other like this:
I tried to rotate the labels on the x-axis by following another solution
cuisine_hist = plt.hist(train.cuisine, bins=100)
cuisine_hist.set_xticklabels(rotation=45)
plt.show()
But I get error message 'tuple' object has no attribute 'set_xticklabels'
. Why? How do I solve this problem? Alternatively, how can I "transpose" the plot so the labels are on the vertical axis?