Title: FIX: colorbar placement in constrained layout by jklymak · Pull Request #11648 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: colorbar placement in constrained layout by jklymak · Pull Request #11648 · matplotlib/matplotlib
X Title: FIX: colorbar placement in constrained layout by jklymak · Pull Request #11648 · matplotlib/matplotlib
Description: PR Summary Closes #11641 Previously, while using constrained_layout putting a colorbar on a figure put the colorbar to the right (or other location) of the parent gridspec of the axes specified. However, the non-constrained_layout way of doing this would just put to the right of the listed axes. This PR makes the constrained_layout behaviour the same as non-constrained_layout import numpy as np import matplotlib.pyplot as plt for CL in (True, False): mappable = [] fig, axs = plt.subplots(2, 2, constrained_layout=CL, figsize=(4.5, 4)) for nn, ax in enumerate(axs.flatten()): data = np.random.randn(10, 10) mappable += [ax.pcolormesh(data)] fig.colorbar(mappable[0], ax=axs[:, 0]) fig.colorbar(mappable[1], ax=axs[0, 1]) fig.colorbar(mappable[3], ax=axs[1, 1]) fig.suptitle('constrainedlayout %s'%CL) plt.show() Before: Behaviour of where first colorbar went changed significantly under constrained_layout After Behaviour more consistent... 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
Open Graph Description: PR Summary Closes #11641 Previously, while using constrained_layout putting a colorbar on a figure put the colorbar to the right (or other location) of the parent gridspec of the axes specified. Ho...
X Description: PR Summary Closes #11641 Previously, while using constrained_layout putting a colorbar on a figure put the colorbar to the right (or other location) of the parent gridspec of the axes specified. Ho...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/11648
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cd95e244-2af7-0a49-7fdb-2eb594d06c41 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CBB2:9FF13:1724717:200ED3E:6A572CBB |
| html-safe-nonce | dacc4e200a1a509b14164d506da5e97c69405d9b503221c158d903d63f63a9d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkIyOjlGRjEzOjE3MjQ3MTc6MjAwRUQzRTo2QTU3MkNCQiIsInZpc2l0b3JfaWQiOiI2Nzg3NzE2MzY1OTEyODQ1NDk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 14c64f2b73052bcc1fe6629a6fa29713b23daf2a0906d6c723b31f53df69e0c1 |
| hovercard-subject-tag | pull_request:201113502 |
| 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/11648/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 #11641 Previously, while using constrained_layout putting a colorbar on a figure put the colorbar to the right (or other location) of the parent gridspec of the axes specified. Ho... |
| 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 | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width