Title: Align x and y labels between axes by jklymak · Pull Request #9652 · matplotlib/matplotlib · GitHub
Open Graph Title: Align x and y labels between axes by jklymak · Pull Request #9652 · matplotlib/matplotlib
X Title: Align x and y labels between axes by jklymak · Pull Request #9652 · matplotlib/matplotlib
Description: PR Summary Aligns the x and y labels automatically at draw time. Responds to windows resize. works w/ tight_layout (and presumably #9082) Example: import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt import numpy as np import matplotlib.gridspec as gridspec for after in [True, False]: fig = plt.figure(tight_layout=True) gs = gridspec.GridSpec(2, 2) ax = fig.add_subplot(gs[0,:]) ax.plot(np.arange(0, 1e6, 1000)) ax.set_ylabel('Test') for i in range(2): ax = fig.add_subplot(gs[1, i]) ax.set_ylabel('Booooo') ax.set_xlabel('Hello') if i == 0: for tick in ax.get_xticklabels(): tick.set_rotation(45) if after: # fig.align_ylabels() # fig.align_xlabels() fig.align_labels() # do both x and y fig.savefig('After.png') else: fig.savefig('Before.png') Before After PR Checklist Has Pytest style unit tests Code is PEP 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 Check righthand/top labels align_labels() align titles: Done but #9498 needs to be merged for it to work (or matter) ;-)
Open Graph Description: PR Summary Aligns the x and y labels automatically at draw time. Responds to windows resize. works w/ tight_layout (and presumably #9082) Example: import matplotlib matplotlib.use('Qt5Agg'...
X Description: PR Summary Aligns the x and y labels automatically at draw time. Responds to windows resize. works w/ tight_layout (and presumably #9082) Example: import matplotlib matplotlib.use('Qt5Agg...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/9652
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2b48ba0d-8451-fb30-7de4-9137e6adef85 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8402:3C3A12:CD5AE:118D87:6A567753 |
| html-safe-nonce | 752c4a312d30406cd223cb00f1203c586bffab7ab167029950289d4bc843e497 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDAyOjNDM0ExMjpDRDVBRToxMThEODc6NkE1Njc3NTMiLCJ2aXNpdG9yX2lkIjoiOTE0ODUzNDE0NzkzODAzNjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f7c086ec15cb961b7831c1b894bdc0fdbca0768fefd1c06c3575b36c770ac7ab |
| hovercard-subject-tag | pull_request:150045071 |
| 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/9652/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 Aligns the x and y labels automatically at draw time. Responds to windows resize. works w/ tight_layout (and presumably #9082) Example: import matplotlib matplotlib.use('Qt5Agg'... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width