-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Prepare to change the default pad for AxesDivider.append_axes. #14173
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
Using a nonzero default (configurable from the rcParams and identical to what `plt.subplots()` use) should make this method a bit more user-friendly (note that *none* of the uses of `append_axes` throughout the codebase leaves `pad` to its current default of zero).
c4b37e5
to
e3d0cc2
Compare
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.
These seems good, though I'm quite concerned with our pads being relative to axes sizes that we don't explicitly know a-priori. In hind sight I think it'd have been better if these were in physical units.
But if you want to change that you'll have to do it on subplots(), not on axes_divider? (The point of this PR is just to make AxesDivider (and more generally mpl_toolkits) more consistent with the main library.) |
It was just a comment, not something for this PR... |
Should we switch the default value from None to 0 as part of the PR? In both cases, the current plot is not affected. Will just change when the meaning of None is changed to using rcParams. The difference is in the warnings Keep None:
Switch to 0:
Essentially, it boils down to the intention of the user for using the default:
The by-default warning is good to inform users that the plot appearance will slightly change, but it's bad because it might nag users who don't care. |
Well, Matplotlib's standard policy for this kind of changes has been to keep the default to None for now and nag all users (cf. the stem() LineCollection debate). |
There's a difference to the stem/LineCollection debate. There, one can set the future default value to remove the deprecation warning. This is not possible here because we don't have specified a new default yet. People are forced to use the old default. In the future
will be the same, but
won't. That's at least something we (and users) should be aware of when we ask them to hard-code something. |
Would it be an option to use |
Well, they can hardcode |
Sorry, forget my comment on What actually would work is introducing a default sentinel if people
This is fully compatible with the simple behavior: People who do nothing will experince the same deprecation warning as in your code. But for those who want to get rid of the warning but still use the the default, there's an official way. Alternatively, maybe a bit simpler with |
With the PR as it is, if someone wants to keep the old default and silence the warning they can just pass |
Agreed, accepting as is then. |
Using a nonzero default (configurable from the rcParams and identical to
what
plt.subplots()
use) should make this method a bit moreuser-friendly (note that none of the uses of
append_axes
throughoutthe codebase leaves
pad
to its current default of zero).Inspired by #13775, which also shows the utility of axes_divider.
PR Summary
PR Checklist