# Is this a bug in Seaborn?

I am using the seaborn violin plot feature however the size of the violins aren't what I would expect them to be. Does anyone know whether this is something I am doing wrong, or as I suspect whether this is a bug in seaborn.

The code I am using is the following;

 sns.violinplot(x = "Issue Type", y = "issue_adj_risk_score", data=subset, scale="count", cut =0)


and the chart I can see is like this

As I understand it, becuase I have used the scale ="count" parameter, the sizes of each of these violins should be proportional to an overall count of the number of things in each area. In 'category 1' however (pink) I have a total of 936 with an issue_adj_risk_score of 1 whilst in category 2 (orange) I have a total of 1212 with an issue_adj_risk_score of 1.

I am confused however as the pink is larger than the orange! :-(

Does anyone know why this might be?

EDIT

I am now seeing further problems where the range of a particular category is inconsistent. I have a dataset and used violinplot to plot the below

Here we can see that a certain category (which I have highlighted in red) has a range from 1-4. This surprised me so I looked into the underlying data and it doesn't contain any values at 4. I then took a subset that contained this category only and plotted a violinplot with the same data and got this

Which is what I would have expected to see in the initial chart!

To investigate this further I plotted a boxplot based on the original data once again, and got the following

Which is consistent with the first chart but doesn't reflect the actual data. How can all of these 3 charts come from the same data!!??

• Can you provide the dataset for the visualization? – tuomastik Aug 8 '17 at 19:45
• You should add your dataset as @tuomastik mentioned. Otherwise people can't answer... – Blaszard Aug 12 '17 at 2:19
• The dataset is a bit big to add on here. I could do some aggregation, however I am now seeing a similar problem where the violin for a category has a totally different range when created from different DataFrames, despite the data being exactly the same. – Taylrl Aug 16 '17 at 10:36
• It seems that the scale = "count" option doesn't actually give a representation based on the overall "count" and whilst the data is properly represented, the labels don't match the data. – Taylrl Aug 16 '17 at 12:41
• I am getting a similar problem with the R version. I split the violin plot in positive and negative side to describe a binary with a ratio of 2:1 but the area of each side does not follow this proportion. And, as it is in your case, the count modality does not work properly only for one of the categories I have. – Alessandro Cicchetti Apr 2 at 18:16