Skip to content

Fix removal of shared polar axes. #20009

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
Apr 29, 2021
Merged

Fix removal of shared polar axes. #20009

merged 1 commit into from
Apr 29, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Apr 17, 2021

There's really two separate fixes here:

  • Move isDefault_{maj,min}{loc,fmt} tracking to the Ticker instances,
    where they logically belong (note the previous need to additionally
    track them manually on axes removal, when that info was tracked on
    the Axis). This has the side effect of fixing removal of sharex'd
    polar axes, as ThetaLocators rely on _AxisWrappers which don't have
    that isDefault attribute. (Note that the patch would have resulted
    in a net decrease of lines of code if it didn't need to maintain
    backcompat on isDefault_foos). Closes Removal of x-shared polar axes causes crash #19988. Split out of Allow sharing Locators and Formatters across Axises. #13482.

  • Ensure that RadialLocator correctly propagates Axis information to
    the linear locator it wraps (consistently with ThetaLocator), so that
    when an axes is removed the wrapped linear locator doesn't stay
    pointing at an obsolete axes. This, together with the first patch,
    fixes removal of sharey'd polar axes. Closes Removal of y-shared polar axes causes crash at draw time #19989.

PR Summary

PR Checklist

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

@jklymak jklymak marked this pull request as draft April 23, 2021 16:42
@anntzer anntzer marked this pull request as ready for review April 27, 2021 20:07
There's really two separate fixes here:

- Move isDefault_{maj,min}{loc,fmt} tracking to the Ticker instances,
  where they logically belong (note the previous need to additionally
  track them manually on axes removal, when that info was tracked on
  the Axis).  This has the side effect of fixing removal of sharex'd
  polar axes, as ThetaLocators rely on _AxisWrappers which don't have
  that isDefault attribute.  (Note that the patch would have resulted
  in a net decrease of lines of code if it didn't need to maintain
  backcompat on isDefault_foos).

- Ensure that RadialLocator correctly propagates Axis information to
  the linear locator it wraps (consistently with ThetaLocator), so that
  when an axes is removed the wrapped linear locator doesn't stay
  pointing at an obsolete axes.  This, together with the first patch,
  fixes removal of sharey'd polar axes.
@anntzer anntzer added this to the v3.4.2 milestone Apr 29, 2021
@anntzer
Copy link
Contributor Author

anntzer commented Apr 29, 2021

feel free to remilestone

@timhoffm timhoffm merged commit 75d2b1c into matplotlib:master Apr 29, 2021
@lumberbot-app
Copy link

lumberbot-app bot commented Apr 29, 2021

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.4.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 75d2b1ca32a8f91db31c145ceae8d1d02767cabe
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #20009: Fix removal of shared polar axes.'
  1. Push to a named branch :
git push YOURFORK v3.4.x:auto-backport-of-pr-20009-on-v3.4.x
  1. Create a PR against branch v3.4.x, I would have named this PR:

"Backport PR #20009 on branch v3.4.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

@anntzer
Copy link
Contributor Author

anntzer commented Apr 29, 2021

thanks @timhoffm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removal of y-shared polar axes causes crash at draw time Removal of x-shared polar axes causes crash
3 participants