Closed mlldantas closed 6 months ago
Hi, please reduce this to a minimal, self-contained example. It's not really possible for me to help based on the information here.
Testing something similar with seaborn 0.12.2 indeed gives a non-split violin:
tips = sns.load_dataset('tips')
sns.violinplot(data=tips, y='tip', hue='time', inner='quart', split=True)
Luckily, that problem doesn't exist anymore in the latest seaborn 0.13.2
Upgrading seaborn would be the way forward.
About the other problem: if sns.violinplot(data=catplot_bpsm_01, y="age_median_gyr", hue="Type", inner="quart", split=True, palette={"Observed": palette[1], "Sim01": palette[-1]})
only gives TypeError: 'NoneType' object is not subscriptable
, without further error trace, the most probable cause would be that you have a variable palette
which is None
. You could try print("palette:", palette)
to find out what's inside.
Thanks @jhncls
Hi, thanks @jhncls for checking it. I had tried to show in my request where the problem was, which could be reproduced using Seaborn's embedded examples.
I understand you already closed the issue, but when I opened it I had updated my Seaborn package. It seems that version 0.12.2 is the latest one available for conda updates. Therefore, my problem persists.
Seaborn v0.13.0 was released on PyPI in September 2023 (and there have been a couple additional releases since).
The main anaconda channel is very slow to update packages so if you want to use the conda
tool to manage your packages it is strongly recommended to use the conda-forge
channel, which typically updates quickly after a PyPI release. I do not have any ability to influence the anaconda update cadence.
Cool, thanks for explaining that. I just updated it using pip and github actually. I will test if everything runs smoothly.
FYI, everything worked smoothly with version 0.13.2, including the palette. Thank you for your help!
Hi,
I am trying to re-run a previous code that worked very well to create grouped asymmetrical violin plots. I am getting several errors that were not happening (maybe 6 months ago) and now am I trying to constrain the errors. I think one of the issues is that I am not providing an x= value (because when I run Seaborn's example, it works, albeit the deprecation warnings).
The code is rather complicated because it's two violin plots with another tiny one zoomed into a range I want to show. The error is happening very early, when I try to run the sns.violinplot. This is the full code:
The error is happening here already:
When I simplify this with:
sns.violinplot(data=catplot_bpsm_01, y="age_median_gyr", hue="Type", inner="quart", split=True)
I am not getting a split violin, I am getting a regular violin. It is completely ignoring the split part. When I add the palette part,
palette={"Observed": palette[1], "Sim01": palette[-1]}
, it gives me this message:I have no idea why this is happening. This is the image I was previously generating with the original code above:
Also, this is the shape of the data I am using:
Current Seaborn version: 0.12.2