Title: Fix SubFigure wspace/hspace None defaulting to subplot rc spacing by Fstarnb · Pull Request #32080 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix SubFigure wspace/hspace None defaulting to subplot rc spacing by Fstarnb · Pull Request #32080 · matplotlib/matplotlib
X Title: Fix SubFigure wspace/hspace None defaulting to subplot rc spacing by Fstarnb · Pull Request #32080 · matplotlib/matplotlib
Description: Description Without a layout engine, Figure.subfigures documents that unspecified wspace / hspace is zero. GridSpec still substitutes figure.subplot.{w,h}space rc defaults (typically 0.2) when given None, so: subfigures(..., wspace=0.2, hspace=None) incorrectly added a vertical gap subfigures(..., wspace=None, hspace=0.2) incorrectly added a horizontal gap This is a regression from #25960 (confirmed in #32076). Fix: when no layout engine is active, coerce missing wspace/hspace to 0.0 before constructing the GridSpec. Related Issue Fixes #32076 How Has This Been Tested? Local verification (Agg, matplotlib 3.10.x / main sources): Red on main: wspace=0.2, hspace=None → subfigure height ≈ 181.82 (gap from default hspace=0.2) Green with fix: same call → height = 200 (half of 400px figure, no vertical gap) Issue reproducer bounds match expected: both None → tiled (0, 200, 300, 200) etc. only wspace → horizontal spacing only only hspace → vertical spacing only Existing test_subfigures_wspace_hspace still passes New test_subfigures_partial_spacing_none_is_zero covers the three cases above Checklist Targeted bug fix with regression test Documented behavior matches implementation for no-layout-engine path No open competing PR for #32076 (rechecked before open)
Open Graph Description: Description Without a layout engine, Figure.subfigures documents that unspecified wspace / hspace is zero. GridSpec still substitutes figure.subplot.{w,h}space rc defaults (typically 0.2) when give...
X Description: Description Without a layout engine, Figure.subfigures documents that unspecified wspace / hspace is zero. GridSpec still substitutes figure.subplot.{w,h}space rc defaults (typically 0.2) when give...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/32080
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f2aa8f96-7d87-f70f-a341-2ac0a44ced4e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B3A:1C99E6:4E431B:6D238E:6A639C45 |
| html-safe-nonce | c4435e7f5990d3d989a13af96eb2221651958a3f5eb1120ffe68bff3c26296e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjNBOjFDOTlFNjo0RTQzMUI6NkQyMzhFOjZBNjM5QzQ1IiwidmlzaXRvcl9pZCI6IjQ2NzU5OTU4MzI1NTA2NjExODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e2369a9df30f3bfdcf2faa4ff1e99b1eddc3bb8c8cd27e58a3d5c0c08b5a2a76 |
| hovercard-subject-tag | pull_request:4093131223 |
| 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/32080/files |
| twitter:image | https://avatars.githubusercontent.com/u/78671757?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/78671757?s=400&v=4 |
| og:image:alt | Description Without a layout engine, Figure.subfigures documents that unspecified wspace / hspace is zero. GridSpec still substitutes figure.subplot.{w,h}space rc defaults (typically 0.2) when give... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ca676e17c4da4532dc68541e9fc874034ae840c26b5f34da7f1c42d9a600659 |
| 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 | 3a0a9f049e072eb8e5795dfddcefdba9e277501d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width