In the example, the documents use:
plt.setp(xtickNames, rotation=45, fontsize=8)
so in your case, I would think: ax.set_ticklabels(range(N), rotation=45, fontsize=8) will give you an angle, but they still overlap. So try:
import matplotlib.pyplot as plt N =100 menMeans = range(N) ind = range(N) ticks = ind fig = plt.figure() ax = fig.add_subplot(111) rects1 = ax.bar(ind, menMeans, align = 'center') ax.set_xticks(range(0,N,10)) ax.set_xticklabels( range(0,N,10), rotation=45 ) plt.show()

source share