New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better document meaning of notches in boxplots #3631
Comments
cc @phobson |
Digging into the code a bit, it looks like it is using the confidence intervals to determine the size of the notch and what is happening is that the internal extends past the 1st or 3rd quartile. I can see two ways to fix this:
This is a relatively easy code fix (around L3426 in |
If that's where the confidence limits are, then there's nothing wrong. Mathematically it's perfectly plausible that the lower CL on the median is less than the first quartile. My boxplots appear like this all the time and seeing the notch inversion is a very useful visual key. |
Fair enough. I did not consider that this was the correct behaviour.... |
Just for thoroughness, I'm going to jump into -- ::deep breath:: -- R and confirm |
Whatever decision is made, it might make sense to add an image test On Fri, Oct 10, 2014 at 12:35 PM, Paul Hobson notifications@github.com
|
worth noting that R raises a warning:
But I think that's a poor message as it essentially tells the user that they should hide the fact that the values of the medians are uncertain. To @rasbt, you can use: bplot = plt.boxplot(data, notch=True, bootstrap=20000) to maybe tighten up the medians' confidence limit |
I am convinced that this is correct behaviour and just needs some documentation and a test to make sure that confused people like me don't try to 'fix' it in the future. |
Sorry for the confusion, you are absolutely right. This was actually a very stupid question in retrospect and this "flipping" behavior is quite useful information as @phobson pointed out :). Maybe it would be worthwhile to add this to documentation though. Or maybe a warning message that the confidence interval is very uncertain in those cases where upper CI > quartile 3 and lower CI < quartile 1. |
notch
shape
I think "won't fix" label needs to be removed, now that this is a documentation ticket? (Thanks for the thorough investigation here and at https://stackoverflow.com/questions/26291082 btw.) |
good point. tag removed. |
Hi,
I found a problem regarding the
boxplot
function when thenotch
shape is being used (matplotlib 1.4.0).I uploaded an self-contained example as IPython notebook with more details.
The text was updated successfully, but these errors were encountered: