-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
DataFrame.boxplot returns a dict instead of axes #4264
Comments
@TomAugspurger address in 0.14? bump? |
I'll just fix the docstring quick. Then there's #4472 that may change the actual behavior. |
This is a bit annoying. I think the dict should be the optional return and the axes always returned, though this breaks backwards compatibility. I think there's even a new boxplot API in maplotlib that might be used. Either way it should be a trivial fix. To get the axes from the boxplot dict you can just do something like
|
Agreed about the dict. #4472 will change it to always return an array, and I'm fine with breaking backwards compat for that. |
yes, ok about breaking this in 0.14 (it needs to be). |
That's not how I read the changeset there. It will always return None if by |
The reason to optionally return the boxplot dict (and why I originally wanted it) is because I don't think you can recover it from just the axes, so you're left with a plot that's really hard to update unless you know what you're doing. Not that the status quo with the dict is all that much better, but at least you know what the objects are for in the case of the dict. |
Also, as another workaround, just create your axes first.
This is actually what I end up doing most of the time since, if not, pandas |
what about (these both break)
|
Returning both sounds reasonable to me. I never followed this closely. |
@TomAugspurger @hayd @cpcloud are we going to change this for 0.14? |
this getting changed / pushed? |
closed by #7096 |
The docstring for
DataFRame.boxplot
claims that the method returns matplotlib axes:In fact, it instead returns a dict:
Aside from being inconsistent with the documentation, this is inconvenient because I am no longer able to manipulate the axes of the plot directly.
Using Pandas 0.12.0.dev-af85719
The text was updated successfully, but these errors were encountered: