I'm creating a plot using the following code:
[...]
# print a bar plot of the results
plt.bar(range(length), buckets)
# add x-axis ticks (dates)
plt.xticks(range(length), days, rotation=70)
# some cosmetics: hide all ticks
plt.setp(plt.gca().get_xticklabels(), visible=False)
# show every 30th tick again
plt.setp(plt.gca().get_xticklabels()[::30], visible=True)
# show the result
plt.show()
My problem is that the names of my X Axis are way to big (in terms of length). Is there a way to show only the first 5 (or n) chars of every tick? Or possibly edit them completely?