Thanks to visit codestin.com
Credit goes to github.com

Skip to content

boxplot treats iterables differently by type #2539

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

Closed
jseabold opened this issue Oct 23, 2013 · 4 comments
Closed

boxplot treats iterables differently by type #2539

jseabold opened this issue Oct 23, 2013 · 4 comments

Comments

@jseabold
Copy link
Contributor

It's stated in the documentation, but I find this behavior to be rather wart-y, and it led to some bugs in statsmodels. Why treat x array different from x sequence of lists?

For an array it iterates over the first axis

import numpy as np
import matplotlib.pyplot as plt

x = np.random.normal(size=(2,1000))
fig, ax = plt.subplots()

ax.boxplot(x.T)

for lists it iterates over the zero axis

fig, ax = plt.subplots()
ax.boxplot([x[0,:],x[1,:]])

Why the distinction? I'd expect them to be the same (i.e., the list gets an np.asarray call) and it seems inconsistent that they're not.

@efiring
Copy link
Member

efiring commented Oct 27, 2013

From the general mpl and python standpoints, I agree entirely with @jseabold. It is unfortunate that this aspect of the signature is present; the question is what, if anything, to do about it now.

@tacaswell
Copy link
Member

@jseabold Have you seen PR #2643 to overhaul boxplot by @phobson?

@tacaswell tacaswell added this to the v1.5.x milestone Aug 17, 2014
@tacaswell
Copy link
Member

This might have to get punted to 2.0

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@anntzer
Copy link
Contributor

anntzer commented Oct 19, 2017

I think most of the discussion is in #8092 now.

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

No branches or pull requests

6 participants