-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix clear of Axes that are shared. #20826
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 reverts a portion of a15bc47, which cleared information that was only known by Subplots or GridSpec at initialization time, and stored on the ticks. Probably the storage of this information and initialization needs to be thoroughly reviewed so that it is stored in the right place. Fixes matplotlib#20721.
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.
Despite my view that "clear" should be closer to "go back to state just after init", that has not in fact been the behavior. The reverts a change that started clearing more things and resulted in two bug reports as regressions in 3.4.2 for 3.4.1.
We should merge this for 3.4.3 so we have one micro version with undocumented behavior change. If we feel compelled we can open up a follow on discussion to fully defined (and document) what clear / cla should do.
The meaning of "clear" is pretty ambiguous, and not helped by either the docstring, or the code. Returning a new axes is certainly appealing, but again, which of the initial arguments passed to the constructor should be preserved? I think folks must have figured it out by trial and error. |
…826-on-v3.4.x Backport PR #20826 on branch v3.4.x (Fix clear of Axes that are shared.)
This is a follow-up to matplotlib#20826, which makes the exceptions from clearing more explicit.
PR Summary
This reverts a portion of a15bc47, which cleared information that was only known by Subplots or GridSpec at initialization time, and stored on the ticks.
Probably the storage of this information and initialization needs to be thoroughly reviewed so that it is stored in the right place.
Fixes #20721.
Fixes #20219.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).