I have a question that is basically the same as a question back from 2014 (see here). However, my script still throws an error.
Here is what I do: I have a pandas datafr
The question you link to uses a factorplot
. A factorplot returns its own class which has a method called set_xticklabels(rotation)
. This is different from the set_xticklabels
method of the matplotlib Axes
.
In the linked question's answers there are also other options which you may use
ax = sns.boxplot(x='categories', y='oxygen', hue='target', data=df)
ax.set_xticklabels(ax.get_xticklabels(),rotation=30)
or
ax = sns.boxplot(x='categories', y='oxygen', hue='target', data=df)
plt.setp(ax.get_xticklabels(), rotation=45)