Skip to content
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

boxplot() draws (min, max) whiskers after a zero-IQR input regardless of whis value #3468

Closed
barusan opened this issue Sep 4, 2014 · 4 comments
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@barusan
Copy link

barusan commented Sep 4, 2014

When pyplot.boxplot() receives a list of lists one of that is zero-IQR as input X, box and whisker plots of subsequent columns of X will have (min, max) whisker regardless of the value of whis.

For example,

X = [data, [0.5], data]     
plt.boxplot(X) # whis = 1.5, flier points should be plotted for the first and third columns of X.

the script like above will draw the following figure.

plt

I suspect this commit.

@barusan barusan changed the title boxplot() draws (min, max) whiskers after a zero-IQR input regardless of whis boxplot() draws (min, max) whiskers after a zero-IQR input regardless of whis value Sep 4, 2014
@WeatherGod
Copy link
Member

Good catch! I think I see what is wrong here. The "whis" variable is
incorrectly modified in the for-loop, and so it has the third list item's
"whis" is set to "range" because that is what the value got forced into
with the second dataset.

On Thu, Sep 4, 2014 at 9:01 AM, バル notifications@github.com wrote:

When pyplot.boxplot() receives a list of lists one of that is zero-IQR as
input X, box and whisker plots of subsequent columns of X will have (min,
max) whisker regardless of the value of whis.

Sample code to reproduce this (possible) bug:
X = [data, [0.5], data]

plt.boxplot(X)

[image: plt]
https://cloud.githubusercontent.com/assets/580998/4149388/39d6b394-3433-11e4-9c0e-ab13db034608.png

I suspect this commit
7cf8b35
.


Reply to this email directly or view it on GitHub
#3468.

@tacaswell tacaswell added this to the v1.4.1 milestone Sep 4, 2014
@tacaswell
Copy link
Member

Probably related to #3459

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Sep 18, 2014
Restore the value of `whis` to the input value at the top of each pass
through the for-loop.

@WeatherGod hit the nail on the head.

closes matplotlib#3468
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Sep 18, 2014
Restore the value of `whis` to the input value at the top of each pass
through the for-loop.

@WeatherGod hit the nail on the head.

closes matplotlib#3468
@kay10
Copy link

kay10 commented Feb 25, 2016

If the input whis value is sequence of percentiles e.g. [5,95], a zero IQR will set whiskers to min/max value as whis = 'range', which is not desirable. You were trying to solve same problem here too.

@tacaswell
Copy link
Member

@kay10 Can you move this discussion over to #5331 then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

No branches or pull requests

4 participants