Relative Content

Tag Archive for pythonchartsseabornboxplot

How to avoid plotting a box when number of abservations is too low with seaborn boxplot?

I’m using seaborn boxplot to plot a bunch of boxes representing some errors when varying a variable that ranges from 0 to 30. When that variable is low, like 0, 1 or 2, I have a lot of observations to make the box, but for values between 17 and 29 I have less than 4 observations and therefore I consider plotting a box is not appropriate, this is even more notorious in the 29th box which only has one observation, making the box absurdly thin, or in some cases where there are only two observations, drawing whiskers seems simply nonsensical.