Title: Removal of y-shared polar axes causes crash at draw time · Issue #19989 · matplotlib/matplotlib · GitHub
Open Graph Title: Removal of y-shared polar axes causes crash at draw time · Issue #19989 · matplotlib/matplotlib
X Title: Removal of y-shared polar axes causes crash at draw time · Issue #19989 · matplotlib/matplotlib
Description: Bug report Bug summary All's in the title. Code for reproduction from pylab import * ax1, ax2 = gcf().subplots(2, sharey=True, subplot_kw={"projection": "polar"}); ax2.remove(); show() Actual outcome Traceback (most recent call last): Tr...
Open Graph Description: Bug report Bug summary All's in the title. Code for reproduction from pylab import * ax1, ax2 = gcf().subplots(2, sharey=True, subplot_kw={"projection": "polar"}); ax2.remove(); show() Actual outco...
X Description: Bug report Bug summary All's in the title. Code for reproduction from pylab import * ax1, ax2 = gcf().subplots(2, sharey=True, subplot_kw={"projection": "polar"}); ax2.remov...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19989
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Removal of y-shared polar axes causes crash at draw time","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nAll's in the title.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nfrom pylab import *\r\nax1, ax2 = gcf().subplots(2, sharey=True, subplot_kw={\"projection\": \"polar\"}); ax2.remove(); show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\nTraceback (most recent call last):\r\nTraceback (most recent call last):\r\n File \".../path/to/matplotlib/backends/backend_qt5.py\", line 440, in _draw_idle\r\n self.draw()\r\n File \"/home/antony/src/local/mplcairo/lib/mplcairo/base.py\", line 269, in draw\r\n self.get_renderer(_ensure_cleared=True, _ensure_drawn=True)\r\n File \"/home/antony/src/local/mplcairo/lib/mplcairo/base.py\", line 261, in get_renderer\r\n return self._get_cached_or_new_renderer(\r\n File \"/home/antony/src/local/mplcairo/lib/mplcairo/base.py\", line 256, in _get_cached_or_new_renderer\r\n self.figure.draw(renderer)\r\n File \".../path/to/matplotlib/artist.py\", line 74, in draw_wrapper\r\n result = draw(artist, renderer, *args, **kwargs)\r\n File \".../path/to/matplotlib/artist.py\", line 51, in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n File \".../path/to/matplotlib/figure.py\", line 2730, in draw\r\n mimage._draw_list_compositing_images(\r\n File \".../path/to/matplotlib/image.py\", line 132, in _draw_list_compositing_images\r\n a.draw(renderer)\r\n File \".../path/to/matplotlib/_api/deprecation.py\", line 447, in wrapper\r\n return func(*inner_args, **inner_kwargs)\r\n File \".../path/to/matplotlib/_api/deprecation.py\", line 447, in wrapper\r\n return func(*inner_args, **inner_kwargs)\r\n File \".../path/to/matplotlib/projections/polar.py\", line 994, in draw\r\n super().draw(renderer, *args, **kwargs)\r\n File \".../path/to/matplotlib/artist.py\", line 51, in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n File \".../path/to/matplotlib/_api/deprecation.py\", line 421, in wrapper\r\n return func(*inner_args, **inner_kwargs)\r\n File \".../path/to/matplotlib/axes/_base.py\", line 3102, in draw\r\n mimage._draw_list_compositing_images(renderer, self, artists)\r\n File \".../path/to/matplotlib/image.py\", line 132, in _draw_list_compositing_images\r\n a.draw(renderer)\r\n File \".../path/to/matplotlib/artist.py\", line 51, in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n File \".../path/to/matplotlib/axis.py\", line 1124, in draw\r\n ticks_to_draw = self._update_ticks()\r\n File \".../path/to/matplotlib/axis.py\", line 1011, in _update_ticks\r\n major_locs = self.get_majorticklocs()\r\n File \".../path/to/matplotlib/axis.py\", line 1243, in get_majorticklocs\r\n return self.major.locator()\r\n File \".../path/to/matplotlib/projections/polar.py\", line 432, in __call__\r\n return [tick for tick in self.base() if tick \u003e rorigin]\r\n File \".../path/to/matplotlib/projections/polar.py\", line 432, in __call__\r\n return [tick for tick in self.base() if tick \u003e rorigin]\r\n File \".../path/to/matplotlib/ticker.py\", line 2265, in __call__\r\n return self.tick_values(vmin, vmax)\r\n File \".../path/to/matplotlib/ticker.py\", line 2273, in tick_values\r\n locs = self._raw_ticks(vmin, vmax)\r\n File \".../path/to/matplotlib/ticker.py\", line 2212, in _raw_ticks\r\n nbins = np.clip(self.axis.get_tick_space(),\r\n File \".../path/to/matplotlib/axis.py\", line 2513, in get_tick_space\r\n length = ((ends[1][1] - ends[0][1]) / self.axes.figure.dpi) * 72\r\nAttributeError: 'NoneType' object has no attribute 'dpi'\r\n```\r\n\r\n**Expected outcome**\r\n\r\nNormal axes removal.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: linux\r\n * Matplotlib version (`import matplotlib; print(matplotlib.__version__)`): head\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): mplcairo\r\n * Python version: 39\r\n * Jupyter version (if applicable): \r\n * Other libraries: \r\n\r\n(Note that this is a separate issue from https://github.com/matplotlib/matplotlib/issues/19988 as the root cause seems very different.)\r\n\r\nEdit: I have a fix, but the test is a bit simpler if https://github.com/matplotlib/matplotlib/pull/19994 goes in first.","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2021-04-16T16:50:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/19989/matplotlib/issues/19989"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ef1b988-d298-aa6f-1594-d54e525fcade |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF58:A6E9E:36261EB:4A5B20F:6A54B065 |
| html-safe-nonce | f8a5a5457c82a6e49f56684f1126c0e74016d0ff347a0644c7220b302afdf400 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjU4OkE2RTlFOjM2MjYxRUI6NEE1QjIwRjo2QTU0QjA2NSIsInZpc2l0b3JfaWQiOiIyMzQwNjIyNjM4MjUzMzg3ODc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8004108128ff81547d0e9fc4c305e224cfd4c7a56c493dc7c6ef6301e4f2aa0c |
| hovercard-subject-tag | issue:859992997 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/19989/issue_layout |
| twitter:image | https://opengraph.githubassets.com/216df4a2890adade6948be4eec9a7a763bf1cd3276c8d5847901cb7c2231d6e1/matplotlib/matplotlib/issues/19989 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/216df4a2890adade6948be4eec9a7a763bf1cd3276c8d5847901cb7c2231d6e1/matplotlib/matplotlib/issues/19989 |
| og:image:alt | Bug report Bug summary All's in the title. Code for reproduction from pylab import * ax1, ax2 = gcf().subplots(2, sharey=True, subplot_kw={"projection": "polar"}); ax2.remove(); show() Actual outco... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width