Title: Adding subplots dynamically with constrained_layout · Issue #19730 · matplotlib/matplotlib · GitHub
Open Graph Title: Adding subplots dynamically with constrained_layout · Issue #19730 · matplotlib/matplotlib
X Title: Adding subplots dynamically with constrained_layout · Issue #19730 · matplotlib/matplotlib
Description: For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout. The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec is set-up and the current axes are repo...
Open Graph Description: For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout. The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec...
X Description: For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout. The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19730
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Adding subplots dynamically with constrained_layout","articleBody":"For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout.\r\nThe whole adding a new axes is unnecesarily complex but it can be done. A new gridspec is set-up and the current axes are repositioned into their new \"slots\". This is working.\r\n\r\nHowever the constrained_layout solver fails (error that height or width is 0).\r\n\r\n### Proposed Solution\r\n\r\nIt seems that some work has already been performed as part of setting a colorbar. It seems to me that with some effort it would be possible to extend that solution to be more generic.\r\n\r\nOtherwise the whole layout boxes set-up could be exposed to the external API, such that the users can use it in a similar fashion.\r\n\r\n(Ideally the matploplib API could make simpler adapating the gridspec after it has been created)\r\n\r\n### Additional context and prior art\r\n\r\nNone","author":{"url":"https://github.com/juliospain","@type":"Person","name":"juliospain"},"datePublished":"2021-03-18T05:09:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/19730/matplotlib/issues/19730"}
| 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:9a88e7a0-6dd6-c6a1-f215-111e9b00eb03 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95AA:14A013:4EB091:6856B2:6A52FF46 |
| html-safe-nonce | 62b4df7d74c6cafb9e47a3febe5a5efc439314865dd27f7fb5d70e9079399432 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUFBOjE0QTAxMzo0RUIwOTE6Njg1NkIyOjZBNTJGRjQ2IiwidmlzaXRvcl9pZCI6IjE3NzgxNjc2MzE0NDI3MzczNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f172e943c7ae53b363bff9473db4606a4ed9c5dd919a65c73825506fc1160cfc |
| hovercard-subject-tag | issue:834397516 |
| 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/19730/issue_layout |
| twitter:image | https://opengraph.githubassets.com/85c54cac4397354d2aff0ef407c4c7f74acd7727f43cfb075b638819eb853388/matplotlib/matplotlib/issues/19730 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/85c54cac4397354d2aff0ef407c4c7f74acd7727f43cfb075b638819eb853388/matplotlib/matplotlib/issues/19730 |
| og:image:alt | For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout. The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | juliospain |
| 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