Title: [Bug]: Cannot toggle set_tight_layout · Issue #22847 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Cannot toggle set_tight_layout · Issue #22847 · matplotlib/matplotlib
X Title: [Bug]: Cannot toggle set_tight_layout · Issue #22847 · matplotlib/matplotlib
Description: Bug summary As of #20426 calling Figure.set_tight_layout(False) does not disable the tight layout algorithm. Code for reproduction from matplotlib import pyplot as plt fig, ax = plt.subplots() fig.set_tight_layout(True) fig.set_tight_lay...
Open Graph Description: Bug summary As of #20426 calling Figure.set_tight_layout(False) does not disable the tight layout algorithm. Code for reproduction from matplotlib import pyplot as plt fig, ax = plt.subplots() fig....
X Description: Bug summary As of #20426 calling Figure.set_tight_layout(False) does not disable the tight layout algorithm. Code for reproduction from matplotlib import pyplot as plt fig, ax = plt.subplots() fig....
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/22847
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Cannot toggle set_tight_layout","articleBody":"### Bug summary\r\n\r\nAs of #20426 calling `Figure.set_tight_layout(False)` does not disable the tight layout algorithm. \r\n\r\n### Code for reproduction\r\n\r\n```python\r\nfrom matplotlib import pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\nfig.set_tight_layout(True)\r\nfig.set_tight_layout(False)\r\nassert not fig.get_tight_layout()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nAssertionError\r\n\r\n### Expected outcome\r\n\r\nclean exit\r\n\r\n### Additional information\r\n\r\nI'm pretty sure [this branch](https://github.com/matplotlib/matplotlib/blob/88371856684ee5ca12a04a084354d8592e49386e/lib/matplotlib/figure.py#L2502-L2503) just needs to set `self.set_layout_engine(None)` in the falsey case. Attn: @jklymak \r\n\r\n### Operating system\r\n\r\n_No response_\r\n\r\n### Matplotlib Version\r\n\r\nmain\r\n\r\n### Matplotlib Backend\r\n\r\n_No response_\r\n\r\n### Python version\r\n\r\n_No response_\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\n_No response_","author":{"url":"https://github.com/richardsheridan","@type":"Person","name":"richardsheridan"},"datePublished":"2022-04-14T13:11:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/22847/matplotlib/issues/22847"}
| 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:d587039b-d224-701d-94dd-8df6016cbe7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF00:2E23E:2E0E433:40492C3:6A50DD36 |
| html-safe-nonce | c9a851481c3e32b2c5dad90420ffce277cdc2f68818bc5a42f8305d84de1a920 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjAwOjJFMjNFOjJFMEU0MzM6NDA0OTJDMzo2QTUwREQzNiIsInZpc2l0b3JfaWQiOiI2NTMxMzI1OTA5NDcwODYyNjQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dac210ddd2861266f38c44b529d0bdb2f448981fa67feb98bb3148ede4dda3a8 |
| hovercard-subject-tag | issue:1204512273 |
| 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/22847/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2633c54c401f673f49df914a391053930b40e9f420dfa0f195557047a63b6d9a/matplotlib/matplotlib/issues/22847 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2633c54c401f673f49df914a391053930b40e9f420dfa0f195557047a63b6d9a/matplotlib/matplotlib/issues/22847 |
| og:image:alt | Bug summary As of #20426 calling Figure.set_tight_layout(False) does not disable the tight layout algorithm. Code for reproduction from matplotlib import pyplot as plt fig, ax = plt.subplots() fig.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | richardsheridan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| 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 | 17290b65caabb92b271e0949d1bf147b63deab41 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width