Title: [Bug]: plt.tight_layout() after layout='constrained' should at least warn · Issue #24387 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: plt.tight_layout() after layout='constrained' should at least warn · Issue #24387 · matplotlib/matplotlib
X Title: [Bug]: plt.tight_layout() after layout='constrained' should at least warn · Issue #24387 · matplotlib/matplotlib
Description: If a user does something like fig, axs = plt.subplots(2, 2, layout='constrained') .. plt.tight_layout() tight_layout is called, and constrained_layout is ignored. This was originally done because constrained_layout was experimental. Howe...
Open Graph Description: If a user does something like fig, axs = plt.subplots(2, 2, layout='constrained') .. plt.tight_layout() tight_layout is called, and constrained_layout is ignored. This was originally done because c...
X Description: If a user does something like fig, axs = plt.subplots(2, 2, layout='constrained') .. plt.tight_layout() tight_layout is called, and constrained_layout is ignored. This was originally done b...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24387
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: plt.tight_layout() after layout='constrained' should at least warn","articleBody":"If a user does something like\r\n\r\n```python\r\nfig, axs = plt.subplots(2, 2, layout='constrained')\r\n..\r\nplt.tight_layout()\r\n```\r\n`tight_layout` is called, and `constrained_layout` is ignored. This was originally done because `constrained_layout` was experimental. However, people seem to think `constrained_layout` is not working because they have copy-and-pasted, or reflexively added `plt.tight_layout`. \r\n\r\nI'd propose that we at least warn if `plt.tight_layout` is called on a figure with an active layout manager. I'd also be open to this being an error. \r\n\r\n\r\n","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2022-11-06T16:56:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/24387/matplotlib/issues/24387"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e86e9c7-55f3-c412-2215-0f3f1c432625 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C684:18C7E2:21F3D76:2DE05D3:6A53878A |
| html-safe-nonce | 0a8df2754665bd51f7aacd9212565bdd9d10e00c94446d19e8b651f151e939ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjg0OjE4QzdFMjoyMUYzRDc2OjJERTA1RDM6NkE1Mzg3OEEiLCJ2aXNpdG9yX2lkIjoiMTMyMzk3MDc4NjU2NzA5NjIwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9ec13156123cbfd7f501ce9dad32d4045de807acb1378db6ab9a399ec7613388 |
| hovercard-subject-tag | issue:1437469876 |
| 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/_view_fragments/issues/show/matplotlib/matplotlib/24387/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f64fe0fe1c1b3c27a457f773821591e89c3c685a0ca3ffa4d939ebeb56da37c0/matplotlib/matplotlib/issues/24387 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f64fe0fe1c1b3c27a457f773821591e89c3c685a0ca3ffa4d939ebeb56da37c0/matplotlib/matplotlib/issues/24387 |
| og:image:alt | If a user does something like fig, axs = plt.subplots(2, 2, layout='constrained') .. plt.tight_layout() tight_layout is called, and constrained_layout is ignored. This was originally done because c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jklymak |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width