Title: [Bug]: Custom backend stopped working in 3.6.2 · Issue #24524 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Custom backend stopped working in 3.6.2 · Issue #24524 · matplotlib/matplotlib
X Title: [Bug]: Custom backend stopped working in 3.6.2 · Issue #24524 · matplotlib/matplotlib
Description: Bug summary A custom backend that's been working for a few years without a problem, stopped working under Matplotlib 3.6.2. Code for reproduction # mpl.py from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import (_B...
Open Graph Description: Bug summary A custom backend that's been working for a few years without a problem, stopped working under Matplotlib 3.6.2. Code for reproduction # mpl.py from matplotlib._pylab_helpers import Gcf ...
X Description: Bug summary A custom backend that's been working for a few years without a problem, stopped working under Matplotlib 3.6.2. Code for reproduction # mpl.py from matplotlib._pylab_helpers import ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Custom backend stopped working in 3.6.2","articleBody":"### Bug summary\r\n\r\nA custom backend that's been working for a few years without a problem, stopped working under Matplotlib 3.6.2.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\n# mpl.py\r\nfrom matplotlib._pylab_helpers import Gcf\r\nfrom matplotlib.backend_bases import (_Backend, FigureCanvasBase, FigureManagerBase)\r\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg\r\n\r\nclass MyFigureManager(FigureManagerBase):\r\n def show(self):\r\n print(\"MyFigureManager.show()\")\r\n\r\n@_Backend.export\r\nclass MyBackend(_Backend):\r\n FigureCanvas = FigureCanvasAgg\r\n FigureManager = MyFigureManager\r\n\r\n def show(*args, **kwargs):\r\n print(\"MyBackend.show()\")\r\n _Backend.show(*args, **kwargs)\r\n print(\"MyBackend.show() after _Backend\")\r\n```\r\n\r\n```\r\n# plot_mpl.py\r\nimport matplotlib\r\nmatplotlib.use(\"module://mpl\")\r\n\r\nimport matplotlib.pyplot as plt\r\n\r\nplt.plot([1,2,3,4,5])\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nRunning using Matplotlib 3.5.3, this outputs:\r\n```\r\nMyBackend.show()\r\nMyFigureManager.show()\r\nMyBackend.show() after _Backend\r\n```\r\n\r\nBut running using 3.6.2, I get:\r\n```\r\nMyBackend.show()\r\n.../mpl.py:16: UserWarning: Matplotlib is currently using module://mpl, which is a non-GUI backend, so cannot show the figure.\r\n _Backend.show(*args, **kwargs)\r\nMyBackend.show() after _Backend\r\n```\r\n\r\nIn particular, `MyFigureManager.show()` is never called.\r\n\r\n### Expected outcome\r\n\r\nSame behavior under both versions.\r\n\r\n### Operating system\r\n\r\nmacOS\r\n\r\n### Matplotlib Version\r\n\r\n3.5.3, 3.6.2\r\n\r\n### Python version\r\n\r\n3.10.8\r\n","author":{"url":"https://github.com/mrzv","@type":"Person","name":"mrzv"},"datePublished":"2022-11-20T18:11:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/24524/matplotlib/issues/24524"}
| 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:8a611a4a-8ad9-70fe-b48b-dee0d170e83f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E890:2A0FAF:191341D:2245779:6A53ED91 |
| html-safe-nonce | ddeb4c7f1d6fc24f9b788578145bd2532191a1a25f0ebbd8dc097c2e74defce5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODkwOjJBMEZBRjoxOTEzNDFEOjIyNDU3Nzk6NkE1M0VEOTEiLCJ2aXNpdG9yX2lkIjoiNDg2OTEyMTU3MTA0NDk3ODA2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6ef7499f75d5079e437c6e84f4018fd4449a33f22f1be566e0cf55519a5d3b0c |
| hovercard-subject-tag | issue:1456995136 |
| 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/24524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5f0bf6d4cc194ab3b8c148ae5ac538d7f5e1182dab064c5d00be038c1b5b8af5/matplotlib/matplotlib/issues/24524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5f0bf6d4cc194ab3b8c148ae5ac538d7f5e1182dab064c5d00be038c1b5b8af5/matplotlib/matplotlib/issues/24524 |
| og:image:alt | Bug summary A custom backend that's been working for a few years without a problem, stopped working under Matplotlib 3.6.2. Code for reproduction # mpl.py from matplotlib._pylab_helpers import Gcf ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mrzv |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width