Title: Standardize creation of FigureManager from a given FigureCanvas class. by anntzer · Pull Request #18854 · matplotlib/matplotlib · GitHub
Open Graph Title: Standardize creation of FigureManager from a given FigureCanvas class. by anntzer · Pull Request #18854 · matplotlib/matplotlib
X Title: Standardize creation of FigureManager from a given FigureCanvas class. by anntzer · Pull Request #18854 · matplotlib/matplotlib
Description: #16818 showed that it would be nice to have a way to create a new manager with the same backend as a given canvas, even when operating outside of pyplot (so the global backend may not exist). This PR implements such a feature as the FigureCanvas.new_manager classmethod. The new_manager classmethod may appear to belong more naturally to the FigureManager class rather than the FigureCanvas class, but putting it on FigureCanvas has multiple advantages: One may want to create managers at times where all one has is a FigureCanvas instance, which may not even have a corresponding manager (e.g. subplot_tool). A given FigureManager class can be associated with many different FigureCanvas classes (indeed, FigureManagerQT can manage both FigureCanvasQTAgg and FigureCanvasQTCairo and also the mplcairo Qt canvas classes), whereas we don't have multiple FigureManager classes for a given FigureCanvas class. 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).
Open Graph Description: #16818 showed that it would be nice to have a way to create a new manager with the same backend as a given canvas, even when operating outside of pyplot (so the global backend may not exist). This...
X Description: #16818 showed that it would be nice to have a way to create a new manager with the same backend as a given canvas, even when operating outside of pyplot (so the global backend may not exist). This...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/18854
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:583b1e25-7ce2-9138-6260-91eab9302ab7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9698:20E237:2031304:2B0F78F:6A652DC7 |
| html-safe-nonce | 666b63706095019ec09a662502f5b5ef3b9d0acffc01a10bbf9196edb7c648f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njk4OjIwRTIzNzoyMDMxMzA0OjJCMEY3OEY6NkE2NTJEQzciLCJ2aXNpdG9yX2lkIjoiNjY3OTkxNTAwMTc3MTUzNTgxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b01f219d891f4e4b6a249449781d87884a33f4e7d2a96e7c25f70d6159709958 |
| hovercard-subject-tag | pull_request:513425080 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/18854/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | #16818 showed that it would be nice to have a way to create a new manager with the same backend as a given canvas, even when operating outside of pyplot (so the global backend may not exist). This... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width