Skip to content

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

Merged
merged 1 commit into from
Aug 12, 2021
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 11, 2021

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

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [n/a] Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

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.
Copy link
Member

@tacaswell tacaswell left a 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.

@tacaswell tacaswell added this to the v3.4.3 milestone Aug 11, 2021
@jklymak
Copy link
Member

jklymak commented Aug 11, 2021

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.

@jklymak jklymak merged commit abf5f04 into matplotlib:master Aug 12, 2021
@QuLogic QuLogic deleted the fix-shared-clear branch August 12, 2021 20:05
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 12, 2021
QuLogic added a commit that referenced this pull request Aug 12, 2021
…826-on-v3.4.x

Backport PR #20826 on branch v3.4.x (Fix clear of Axes that are shared.)
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 3, 2022
This is a follow-up to matplotlib#20826, which makes the exceptions from clearing
more explicit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants