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!!??
From the seaborn documentation:


  scale : {“area”, “count”, “width”}, optional
  
  The method used to scale the width of each violin. If area, each violin will have the same area. If count, the width of the violins will be scaled by the number of observations in that bin. If width, each violin will have the same width.


So the violins are scaled such that the width is proportional to the number of observations. You were expecting the area to be scaled with count, not the width, and that seems natural to me but that option does not seem to exist in seaborn. Here is an issue regarding this, with a handmade solution:

https://github.com/mwaskom/seaborn/issues/962