I am new to Seaborn and this is probably a very trivial question, however I'm struggling with the solution. I have a Pandas dataset named titanic
I am plotting a bar chart as described in the Seaborn official documentation, using the following code:
import seaborn as sns
titanic = sns.load_dataset("titanic")
sns.catplot(x="sex", y="survived", hue="class", kind="bar", data=titanic)
This produces the following plot:
As you can see, the hue is represented by the class
. Question is: How can I manually choose the hue order so that I can reverse the current one?
所有评论(0)