Title: FIX: long titles x/ylabel layout by jklymak · Pull Request #17222 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: long titles x/ylabel layout by jklymak · Pull Request #17222 · matplotlib/matplotlib
X Title: FIX: long titles x/ylabel layout by jklymak · Pull Request #17222 · matplotlib/matplotlib
Description: PR Summary Closes #8201 Previously, really long titles and axes labels would kill both tight_layout and constrained_layout because they vainly would try and reduce the size of the axes to somehow make the long title "fit". However, this cannot work, so instead just ignore the dimensions these can get too long in. This leads to a few changes, but I still think is better than squishing the axes. import matplotlib.pyplot as plt fig, axs = plt.subplots(1, 2, constrained_layout=True) text = 'My Really long egregious, silly title that should have a carriage return' for ax in axs: ax.set_title(text) plt.show() Before: testLongTitle.py:12: UserWarning: constrained_layout not applied. At least one axes collapsed to zero width or height. (tight layout had a similar check and was not applied) After Now the user gets the layout manager, and the title is allowed to overflow. The only case where maybe this is dubious is just for constrained layout import matplotlib.pyplot as plt fig, axs = plt.subplots(1, 2, constrained_layout=True) text = 'My somewhat long title that overflows a bit' for ax in [axs[0]]: ax.set_title(text) plt.show() Old: Moved the undecorated axes over: New Just lets it look bad: I think the latter is actually better because it tells the user that they really should fix their title, whereas before they got a mysterious message about the axes collapsing and the layout not being applied. 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 Closes #8201 Previously, really long titles and axes labels would kill both tight_layout and constrained_layout because they vainly would try and reduce the size of the axes to somehow m...
X Description: PR Summary Closes #8201 Previously, really long titles and axes labels would kill both tight_layout and constrained_layout because they vainly would try and reduce the size of the axes to somehow m...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/17222
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:692e57ca-e556-ad4d-42fc-63d7ee819b42 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B244:1749AA:15B5448:1EA0C7A:6A574B05 |
| html-safe-nonce | 76fcdcade82392fe5e5db4c9bf34430fcb7695b902d20f57ae9f081963fe7dc7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjQ0OjE3NDlBQToxNUI1NDQ4OjFFQTBDN0E6NkE1NzRCMDUiLCJ2aXNpdG9yX2lkIjoiMTc4NjkyODY1Mjg4NzczOTE0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e7d613f88e5750ce1aa0d3cdf496196501225fe837df2c47f296451c020ae813 |
| hovercard-subject-tag | pull_request:407688997 |
| 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/17222/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 #8201 Previously, really long titles and axes labels would kill both tight_layout and constrained_layout because they vainly would try and reduce the size of the axes to somehow m... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 602250ea3b6dd8302a7220ef98adb828dbc807e4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width