Skip to content
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

Removal of x-shared polar axes causes crash #19988

Closed
anntzer opened this issue Apr 16, 2021 · 1 comment · Fixed by #20009
Closed

Removal of x-shared polar axes causes crash #19988

anntzer opened this issue Apr 16, 2021 · 1 comment · Fixed by #20009
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Apr 16, 2021

Bug report

Bug summary

All's in the title.

(Note that x-sharing (which really means theta-sharing) polar axes makes sense because one can use set_thetalims to draw just a wedge.)

Code for reproduction

from pylab import *
ax1, ax2 = gcf().subplots(2, sharex=True, subplot_kw={"projection": "polar"}); ax2.remove()

Actual outcome

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File ".../path/to/matplotlib/artist.py", line 162, in remove
    self._remove_method(self)
  File ".../path/to/matplotlib/figure.py", line 967, in delaxes
    _reset_locators_and_formatters(last_ax.xaxis)
  File ".../path/to/matplotlib/figure.py", line 930, in _reset_locators_and_formatters
    isDefault = majloc.axis.isDefault_majloc
AttributeError: '_AxisWrapper' object has no attribute 'isDefault_majloc'

Expected outcome

Normal axes removal.

Matplotlib version

  • Operating system: linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): head
  • Matplotlib backend (print(matplotlib.get_backend())): mplcairo
  • Python version: 39
  • Jupyter version (if applicable):
  • Other libraries:

#13482 happens to fix this, because it moves handling of isDefault_* to the tickers themselves (where they logically belong), rather than having them on the axis.

(Note that this is a separate issue from #19989 as the root cause seems very different.)

@anntzer
Copy link
Contributor Author

anntzer commented Apr 29, 2021

feel free to remilestone

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