Title: [Bug]: Constrained layout UserWarning even when False · Issue #23986 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Constrained layout UserWarning even when False · Issue #23986 · matplotlib/matplotlib
X Title: [Bug]: Constrained layout UserWarning even when False · Issue #23986 · matplotlib/matplotlib
Description: Bug summary When using layout settings such as plt.subplots_adjust or bbox_inches='tight, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = False. This was not the case in previous ver...
Open Graph Description: Bug summary When using layout settings such as plt.subplots_adjust or bbox_inches='tight, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = Fals...
X Description: Bug summary When using layout settings such as plt.subplots_adjust or bbox_inches='tight, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Constrained layout UserWarning even when False","articleBody":"### Bug summary\r\n\r\nWhen using layout settings such as `plt.subplots_adjust` or `bbox_inches='tight`, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = False. This was not the case in previous versions.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\na = np.linspace(0,2*np.pi,100)\r\nb = np.sin(a)\r\nc = np.cos(a)\r\nfig,ax = plt.subplots(1,2,figsize=(8,2),constrained_layout=False)\r\nax[0].plot(a,b)\r\nax[1].plot(a,c)\r\nplt.subplots_adjust(wspace=0)\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nThe plot works fine but the warning is generated\r\n\r\n`/var/folders/ss/pfgdfm2x7_s4cyw2v0b_t7q80000gn/T/ipykernel_76923/4170965423.py:7: UserWarning: This figure was using a layout engine that is incompatible with subplots_adjust and/or tight_layout; not calling subplots_adjust.\r\n plt.subplots_adjust(wspace=0)`\r\n\r\n### Expected outcome\r\n\r\nno warning\r\n\r\n### Additional information\r\n\r\nWarning disappears when constrained_layout=False is removed\r\n\r\n### Operating system\r\n\r\nOS/X\r\n\r\n### Matplotlib Version\r\n\r\n3.6.0\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\nconda","author":{"url":"https://github.com/VanWieren","@type":"Person","name":"VanWieren"},"datePublished":"2022-09-22T17:18:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/23986/matplotlib/issues/23986"}
| 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:ffd41fdf-8212-9cb1-0aa5-77c09a2674e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A598:362FC4:A8E879A:AC25B91:6A50A2E9 |
| html-safe-nonce | 620d8fbd28e234dea776668a3c440c521cdcd36fce9d0f91e2af2aa996224216 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTk4OjM2MkZDNDpBOEU4NzlBOkFDMjVCOTE6NkE1MEEyRTkiLCJ2aXNpdG9yX2lkIjoiNzI2Njk0OTczMTYyODEzMTA0OSIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | b4bedaf48ce5292539f719e6638498cb2caf3e21953ac12b10f0c5a9629c901d |
| hovercard-subject-tag | issue:1382773077 |
| 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/23986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/248298cfb6e65b785920fc869b41e258c9b4a8dbee444967599bc0d2cbd4a8d5/matplotlib/matplotlib/issues/23986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/248298cfb6e65b785920fc869b41e258c9b4a8dbee444967599bc0d2cbd4a8d5/matplotlib/matplotlib/issues/23986 |
| og:image:alt | Bug summary When using layout settings such as plt.subplots_adjust or bbox_inches='tight, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = Fals... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | VanWieren |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width