Title: ENH: reuse oldgridspec is possible... by jklymak · Pull Request #17347 · matplotlib/matplotlib · GitHub
Open Graph Title: ENH: reuse oldgridspec is possible... by jklymak · Pull Request #17347 · matplotlib/matplotlib
X Title: ENH: reuse oldgridspec is possible... by jklymak · Pull Request #17347 · matplotlib/matplotlib
Description: PR Summary A major constraint of constrained_layout is that it never worked with add_subplot(2,3,1) because a new gridspec was created each time. This PR causes the gridspec to be reused if nrows and ncols are the same. Replaces #11441. I decided that the grid specs should be exactly the same, so add_subplot(4, 4, 2) would be a different grid than add_subplot(2, 2, 4) despite the fact they could theoretically be made the same. Basically if you want those two axes to be in the same layout, you should specify them as add_subplot(4, 4, 2) and add_subplot(4, 4, (11, 16)) Update: Now works with subplotgrid as well. Closes #15821 PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: PR Summary A major constraint of constrained_layout is that it never worked with add_subplot(2,3,1) because a new gridspec was created each time. This PR causes the gridspec to be reused if nrow...
X Description: PR Summary A major constraint of constrained_layout is that it never worked with add_subplot(2,3,1) because a new gridspec was created each time. This PR causes the gridspec to be reused if nrow...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/17347
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:57950b18-a339-2749-2ad7-da8f63591725 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D282:171A20:1EA4647:29A5826:6A5382B0 |
| html-safe-nonce | 3379b94798e5bdbaa70a16c40f037337e44549949ed7c9d4a382343d6c06fe19 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjgyOjE3MUEyMDoxRUE0NjQ3OjI5QTU4MjY6NkE1MzgyQjAiLCJ2aXNpdG9yX2lkIjoiNTg4MDU0Njg3NzAyODY2Mzk4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e2c7968f7c78903bedd2c94794946497882d1db85ff6c902763d4c5ca4772d07 |
| hovercard-subject-tag | pull_request:414391271 |
| 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/17347/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 A major constraint of constrained_layout is that it never worked with add_subplot(2,3,1) because a new gridspec was created each time. This PR causes the gridspec to be reused if nrow... |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width