-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: do not hard-code matplotlib backend for boxplot #28159
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
Conversation
This was implemented in #27432, and was intentional. My preference was to delegate everything to the backends, but the final decision was to just delegate the plots called via accessor. I'm happy with changing it for boxplot, even if I'd personally deprecate @TomAugspurger thoughts on this change? |
As long as delegating doesn’t get in the way of a future deprecation, then I’m fine with this. |
OK - what threw me off was that it's the only hard-coded backend in that file – the rest use whatever the user has set. Is there a reason for that discrepancy? |
My understanding is that there are these ways of calling a boxplot from pandas: df.plot.box()
df.plot(kind='box')
df.boxplot()
pandas.plotting.boxplot(df) The decision was to delegate to the backend anything that is not a I think we can merge this if it affects you. Otherwise I'd say better don't touch it, and focus on deprecating it. There was an initial discussion on deprecations in #26747, but the scope of the issue was too big and no decision was made on that. I guess deprecating I'll try to open an issue later today to make a decision on that. |
Makes sense – so from the contents of this file it appears that plotting backends can override |
(I'm fine either way, I just think consistency here would make things less confusing for both users and backend authors) |
Note also that the accessor is structured such that |
There are many things in the current API that I think are explained by how things were implemented, and that are inconsistent. That's why I mentioned that I think what we should do is have a discussion on what to deprecate, and leave things simple, standardized and without inconsistencies. Let's see what can be done, I think once there is agreement in what should be done, should be fast to implement the changes. |
I don't think that's correct. From my read, when you call |
I think you're right for It's confusing, that's exactly why I think we should deprecate |
OK – thanks for the clarification. So would you recommend plotting backends define their own version of |
If you want users to be able to plot with your backend when calling Making you implement those is not great, sorry. They won't be needed in the future, I think. But for now this is how the API works. |
OK. For what it's worth, if you're planning to deprecate them I think it would make more sense to have them produce the matplotlib plot in all cases (like The current behavior looks like this:
|
I've updated the PR to reflect how I think it should look given this new information. Honestly, I'm fine either way as long as a consistent choice is made. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my area of expertise but lgtm to keep consistent. @datapythonista
I'm going to close this, because the discussion is larger than the files I've touched here. |
No description provided.