-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[MNT]: Define Axes.clear semantics #28851
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
Comments
Also related to #12819 / #23503 ("Should clearing a shared axes reset its scale?") In fact, thinking about this again, I suspect that "having a consistent behavior when only one of a shared axes is cleared" would more or less impose some choices:
However! this causes other problems, namely that after clearing, the cached data limits become completely wrong. I would guess the "proper" fix there would be the "lazy datalims" idea floated at #28101 (comment). |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Axes.clear()
/Axes.cla()
are only documented as "Clear the Axes". What exactly "clear" means is neither documented nor well defined. We reset some stuff and keep other.This leads to a number of issues:
There has been some inital work in #23839, but the topic is not completely solved.
Proposed fix
We need to define what
clear
means.First on an abstract level: This could be a starting point:
When the high-level definition is agreed upon, we need to define what that means for concrete cases.
e.g. it's clear that we remove label content. Should label positions also be reset (e.g. if somebody has moved the xlabel to top)? - This may also depend on the anticipated use case: One wants to reuse the Axes for a new plot. How similar is it to the old plot. Does it only get new data and labels or could it be a completely different plot?
The text was updated successfully, but these errors were encountered: