Title: [Bug]: Axes.indicate_inset connectors affect constrained layout · Issue #23425 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Axes.indicate_inset connectors affect constrained layout · Issue #23425 · matplotlib/matplotlib
X Title: [Bug]: Axes.indicate_inset connectors affect constrained layout · Issue #23425 · matplotlib/matplotlib
Description: Bug summary When adding indicate_inset on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of layout. Code for reproduction import matplo...
Open Graph Description: Bug summary When adding indicate_inset on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of lay...
X Description: Bug summary When adding indicate_inset on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of lay...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23425
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Axes.indicate_inset connectors affect constrained layout","articleBody":"### Bug summary\n\nWhen adding `indicate_inset` on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of layout.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\n\r\nfor i in range(2):\r\n fig, axs = plt.subplots(2, 1, constrained_layout=True)\r\n for ax in axs:\r\n ax.plot([1, 2, 3])\r\n axs[1].set_xlim(0.5, 1.5)\r\n\r\n# Add inset indicators only on the second figure.\r\n_, conns = axs[0].indicate_inset_zoom(axs[1])\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\nWithout connectors:\r\n\r\nWith connectors:\r\n\r\nThere is now some extra space between the two vertically.\n\n### Expected outcome\n\nIf you add:\r\n```\r\nfor con in conns:\r\n con.set_in_layout(False)\r\n```\r\nthen the Axes as positioned the same as the original image:\r\n\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n37ccdca5028725b3b9d689b42947b6284a73d690\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/QuLogic","@type":"Person","name":"QuLogic"},"datePublished":"2022-07-14T18:47:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/23425/matplotlib/issues/23425"}
| 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:c4bead6b-1978-ced0-f093-fdfbf8271d65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BAE:2A0782:9F8EF1:D5FBA9:6A531597 |
| html-safe-nonce | 200d8b0d69ca660ffbd5c89f9566cf44f570a376660438359df9237f5eae4ff9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkFFOjJBMDc4Mjo5RjhFRjE6RDVGQkE5OjZBNTMxNTk3IiwidmlzaXRvcl9pZCI6IjQyMTI3ODA1MDQ0MTQ2MjMxMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e2d60a18fa592548ccb8eb3c94cb96443fa40a5512db1b2b95b765adfdfa6b79 |
| hovercard-subject-tag | issue:1305165548 |
| 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/23425/issue_layout |
| twitter:image | https://opengraph.githubassets.com/921d6e30ab8641ac624066d64429494a682996461794b1beed7b73dc5e08c0b0/matplotlib/matplotlib/issues/23425 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/921d6e30ab8641ac624066d64429494a682996461794b1beed7b73dc5e08c0b0/matplotlib/matplotlib/issues/23425 |
| og:image:alt | Bug summary When adding indicate_inset on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of lay... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | QuLogic |
| 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