Title: Issue · GitHub
Open Graph Title: Issue · matplotlib/matplotlib
X Title: Issue · matplotlib/matplotlib
Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Opengraph URL: https://github.com/matplotlib/matplotlib
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: layout=compressed conflict with suptitle","articleBody":"### Bug summary\n\nI used layout=compressed to align colorbar and figure, but after I added fig.suptitle the colorbar is not aligned\n\n### Actual outcome\n\nIf I do not add \"fig.suptitle\", the colorbar is aligned with the subfigure\n\n\u003cimg width=\"800\" height=\"400\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/36e23394-6674-4895-8e94-24c8cde58094\" /\u003e\n\n```Python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.arange(100).reshape((10, 10))\nfig, ax = plt.subplots(ncols=2, figsize=(4, 2), layout='compressed')\nim0 = ax[0].imshow(arr)\nim1 = ax[1].imshow(arr)\n\nplt.colorbar(im0, ax=ax[0])\nplt.colorbar(im1, ax=ax[1])\nplt.show()\n```\n\nIf I add \"fig.suptitle\", the colorbar is slightly longer than the subfigure\n\n\u003cimg width=\"800\" height=\"400\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/e927febc-f9d8-4734-a86f-d1846eb0128e\" /\u003e\n\n```\nimport matplotlib.pyplot as plt\nimport numpy as np\n\narr = np.arange(100).reshape((10, 10))\nfig, ax = plt.subplots(ncols=2, figsize=(4, 2), layout='compressed')\nim0 = ax[0].imshow(arr)\nim1 = ax[1].imshow(arr)\n\nplt.colorbar(im0, ax=ax[0])\nplt.colorbar(im1, ax=ax[1])\nfig.suptitle('Title')\nplt.show()\n```\n\n### Expected outcome\n\nIf I do not add \"fig.suptitle\", the colorbar should still aligned to the subfigure, while added a title above them\n\n\n### Matplotlib Version\n\n3.10.3\n","author":{"url":"https://github.com/Firestar-Reimu","@type":"Person","name":"Firestar-Reimu"},"datePublished":"2025-08-26T07:51:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/30472/matplotlib/issues/30472"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:954ef7f5-829b-4f3f-02ea-8b4040684856 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CBC4:F83CB:117F040:1752952:6A51C530 |
| html-safe-nonce | 15345317ad1ff8f45902ce66602c9441010b2ff0e419eb37f9ff2b4657cf4e8c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkM0OkY4M0NCOjExN0YwNDA6MTc1Mjk1Mjo2QTUxQzUzMCIsInZpc2l0b3JfaWQiOiI0NDEwNDI0NzExNzE0MDMwODk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c0aa8495ca243ad4e008c0443216ef7ea0fde1cc817362d269dade2cacca650d |
| hovercard-subject-tag | repository:1385122 |
| github-keyboard-shortcuts | repository,issues,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/issues/30472 |
| twitter:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| og:image:alt | matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width