Rotate label text in seaborn factorplot
I had a problem with the answer by @mwaskorn, namely that
g.set_xticklabels(rotation=30)
fails, because this also requires the labels. A bit easier than the answer by @Aman is to just add
plt.xticks(rotation=45)
This is still a matplotlib object. Try this:
# <your code here>
locs, labels = plt.xticks()
plt.setp(labels, rotation=45)
You can rotate tick labels with the tick_params
method on matplotlib Axes
objects. To provide a specific example:
ax.tick_params(axis='x', rotation=90)