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

pylab_examples/boxplot_demo.py crashes #3220

Closed
mdboom opened this issue Jul 11, 2014 · 2 comments · Fixed by #3284
Closed

pylab_examples/boxplot_demo.py crashes #3220

mdboom opened this issue Jul 11, 2014 · 2 comments · Fixed by #3284
Milestone

Comments

@mdboom
Copy link
Member

mdboom commented Jul 11, 2014

@tacaswell: Any thoughts?

Traceback (most recent call last):
  File "boxplot_demo.py", line 55, in <module>
    boxplot(data)
  File "/home/mdboom/python/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 2636, in boxplot
    meanprops=meanprops, manage_xticks=manage_xticks)
  File "/home/mdboom/python/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/axes/_axes.py", line 3036, in boxplot
    labels=labels)
  File "/home/mdboom/python/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/cbook.py", line 1994, in boxplot_stats
    wiskhi = np.compress(x <= hival, x)
  File "/home/mdboom/python/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 1561, in compress
    return compress(condition, axis, out)
ValueError: condition must be a 1-d array
@tacaswell tacaswell added this to the v1.4.0 milestone Jul 12, 2014
@tacaswell
Copy link
Member

@phobson Thoughts?

@tacaswell
Copy link
Member

The issue is with the final call which tries to make multiple boxplots

boxplot([_.ravel() for _ in data])

works, so it is something funny going on with the input cleaning.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jul 22, 2014
cbook._reshape_2D the input can be _at most_ 2D, however if it
is passed a list of (n, 1) shaped ndarray this condition will
be violated and it fails to work (which is less than great, but
fine from a documentation stand point).  However, boxplot _used_
to work with a list of such ndarrays (and users might expect to
call a (n, 1) shaped array a 1D array).  The added `ravel` makes
sure that even if we get a list of any dimensional ndarrays in, the
output will be a list of (n, ) shaped arrays.

Closes matplotlib#3220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants