Title: FIX: maybe improve renderer dance by jklymak · Pull Request #22732 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: maybe improve renderer dance by jklymak · Pull Request #22732 · matplotlib/matplotlib
X Title: FIX: maybe improve renderer dance by jklymak · Pull Request #22732 · matplotlib/matplotlib
Description: PR Summary Closes #22673 tight_layout and constrained_layout were both calling backend_bases._get_renderer. However, that was probably too low-level, and seems to cause canvas-dpi related flakiness as in #22673, in particular some users were seeing changed dpi because savefig.format was set to a vector backend. This uses the more robust algorithm in _tight_layout.get_renderer. In particular if fig.canvas already exists and has a renderer, use that because it means the user has already (perhaps interactively) created a canvas. This stops prematurely falling back to a default canvas indicated by savefig.format. This probably mostly worked for folks because the default format is png which is enough like on-screen display that things didn't break. PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. 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). Documentation is sphinx and numpydoc compliant (the docs should build without error).
Open Graph Description: PR Summary Closes #22673 tight_layout and constrained_layout were both calling backend_bases._get_renderer. However, that was probably too low-level, and seems to cause canvas-dpi related flakines...
X Description: PR Summary Closes #22673 tight_layout and constrained_layout were both calling backend_bases._get_renderer. However, that was probably too low-level, and seems to cause canvas-dpi related flakines...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/22732
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5344826e-e632-b341-45ef-cf9511482e60 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB26:217E0D:20C7E:28AA9:6A52343D |
| html-safe-nonce | fcd7c622fc944d3537c3eb5cb9e11d9be7832cd1a8902ac2ded0d33e61d25e89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjI2OjIxN0UwRDoyMEM3RToyOEFBOTo2QTUyMzQzRCIsInZpc2l0b3JfaWQiOiI4NDQwNTc3ODQwNTA0Nzc5ODM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 33b546befb4775191c125ff90acdd2399e8987146d82e8540f1734538e4abf76 |
| hovercard-subject-tag | pull_request:894555003 |
| 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/22732/files |
| twitter:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| og:image:alt | PR Summary Closes #22673 tight_layout and constrained_layout were both calling backend_bases._get_renderer. However, that was probably too low-level, and seems to cause canvas-dpi related flakines... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width