Replies: 1 comment
-
I think this is a subtle bug in seaborn that specifically happens with (A) split violins and (B) categorical grouping variable. If you disable the split you can see that it is still trying to draw the other levels (this is by design, there's just a bug where it doesn't handle empty data in those levels properly): What I would do is not worry about selecting rows from the dataframe and instead just ask for a specific level using sns.violinplot(
data=tips,
x="day", y="total_bill", hue="smoker",
order=["Fri"], # <--- Add this
inner="quart", linewidth=1, split=True,
palette={"Yes": "b", "No": ".85"}
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, guys,
I am learning using
seaborn
today, and met an unknow error withsns.violinplot
when selecting only one ‘x’ attribute as,And here was the error message,
Could please tell me how to fix it?Your answer and guide will be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions