Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Deprecate BBox.ignore()#17106
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Deprecate BBox.ignore()#17106
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This has been in my todo list for a while, but as always "it's complicated". If you can pull it off that would be a rather nice simplification. The basic idea (just a quick write up from memory, haven't rechecked) is that the "initial" data limits of a newly created axes is x=(0, 1), y=(0, 1) (so that these are the limits of an empty axes), but this bbox is marked as "ignore_existing_data_limits"/"ignore", so that once one adds data to it for the first time the data limits of that data completely overrides the 0-1. Note that this results in a slight inconsistency with what happens if you call I'm not really sure whether we can choose to change the behavior of |
Didn't think there would be so much overlap when I started work on#17115, but now I see these issues are fundamentally linked. I'll keep that PR draft separate as it has a different goal....but will keep an eye on this, to avoid duplicating effort. |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
The code in the PR is preliminary. The deprecation may not be viable, pending discussion below.
Identified through the discussion in#17090.
Bbox.ignore()
introduces a persistent state that affects whetherBbox.update_from_path()
andBbox.update_from_data_xy()
will set the box extents to their arguments or join the argument extents with the existing extents. This hidden state can be confusing and is dangerous because it might be changed by other parts of the program without knowing.However,
matplotlib/lib/matplotlib/axes/_base.py
Line 2115 in065769b
matplotlib/lib/matplotlib/testing/jpl_units/StrConverter.py
Line 114 in065769b
made me think, if this feature is needed for ignoring data limits (which IMHO would be a questionable design). If so, we'd need a different approach.
Comments welcome.