You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unit tests fail with latest version of seaborn #1420
I skimmed through the code only briefly yesterday but I think the problem might be that both x and y need to be specified: The error message seems to indicate so and the two lines seemingly responsible for the problem are the only ones where x and y are not both specified.
Yes, I saw that too but I was hoping it could be prevented as it seems suboptimal to me and is probably confusing when looking at the code.
Is there a specific reason for using seaborn.FacetGrid instead of seaborn.catplot (see here)? Replacing the lines
# ...kwds.setdefault('cut', 0)
kwds.setdefault('inner')
ifmulti_panelandgroupbyisNoneandlen(ys) ==1:
# This is a quick and dirty way for adapting scales across several# keys if groupby is None.y=ys[0]
g=sns.FacetGrid(obs_tidy, col=x, col_order=keys, sharey=False)
# don't really know why this gives a warning without passing `order`g=g.map(sns.violinplot, y, orient='vertical', scale=scale, order=keys, **kwds)
At the moment, I am just unsure how to plot to each subplot of the new g. It might be possible to loop through the plot grid so not to add everything on top of the last plot.
Besides the not yet solved strip plot problem, would that be a valid alternative?
The following code produces the desired plot (up to permutation of the subplots and the image size) in case of only one row of subplots:
ifmulti_panelandgroupbyisNoneandlen(ys) ==1:
# This is a quick and dirty way for adapting scales across several# keys if groupby is None.y=ys[0]
g=sns.catplot(y=y, data=obs_tidy, kind="violin", col=x, col_order=keys, sharey=False, order=keys, **kwds)
ifstripplot:
grouped_df=obs_tidy.groupby(x)
forax_id, keyinzip(range(g.axes.shape[1]), keys):
sns.stripplot(y=y, data=grouped_df.get_group(key), jitter=jitter, size=size, color="black", ax=g.axes[0, ax_id], **kwds)
Seems a bit hacky to me. What do you think @fidelram?
Activity
fidelram commentedon Sep 17, 2020
@WeilerP Any idea on how to solve the problem? I thought that setting
orient='vertical'was going to solve the issue but we already do that.WeilerP commentedon Sep 17, 2020
I skimmed through the code only briefly yesterday but I think the problem might be that both
xandyneed to be specified: The error message seems to indicate so and the two lines seemingly responsible for the problem are the only ones wherexandyare not both specified.I'll have a closer look at it in a bit.
fidelram commentedon Sep 17, 2020
Looking at this function which is called by seaborn violin (https://github.com/mwaskom/seaborn/blob/cf8af7e1c4ffd5d0044d13323731fa5066c057c8/seaborn/_core.py#L1260) it seems that what we need to do is swap x and y.
WeilerP commentedon Sep 17, 2020
Yes, I saw that too but I was hoping it could be prevented as it seems suboptimal to me and is probably confusing when looking at the code.
Is there a specific reason for using
seaborn.FacetGridinstead ofseaborn.catplot(see here)? Replacing the lineshere by
gives the desired plot (except for different size). The strip plot can be added on top by calling
seaborn.stripplotafterwards:At the moment, I am just unsure how to plot to each subplot of the new
g. It might be possible to loop through the plot grid so not to add everything on top of the last plot.Besides the not yet solved strip plot problem, would that be a valid alternative?
fidelram commentedon Sep 17, 2020
There is not particular reason to use FacetGrid. If catplot does the job then it is ok.
WeilerP commentedon Sep 17, 2020
The following code produces the desired plot (up to permutation of the subplots and the image size) in case of only one row of subplots:
Seems a bit hacky to me. What do you think @fidelram?
fidelram commentedon Sep 17, 2020
@WeilerP probably there is a more direct way to overlay the stripplot but I don't think that it makes any big difference.
Can you make a PR to see how the tests work?