Title: [ENH]: gridspec_mosaic · Issue #24571 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: gridspec_mosaic · Issue #24571 · matplotlib/matplotlib
X Title: [ENH]: gridspec_mosaic · Issue #24571 · matplotlib/matplotlib
Description: Problem Trying to combine subplot_mosaic with axes using various different projections (e.g. one rectilinear axes and one polar axes and one 3d axes) has been requested a few times (once in the original subplot_mosaic thread IIRC, and in...
Open Graph Description: Problem Trying to combine subplot_mosaic with axes using various different projections (e.g. one rectilinear axes and one polar axes and one 3d axes) has been requested a few times (once in the ori...
X Description: Problem Trying to combine subplot_mosaic with axes using various different projections (e.g. one rectilinear axes and one polar axes and one 3d axes) has been requested a few times (once in the ori...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24571
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: gridspec_mosaic","articleBody":"### Problem\n\nTrying to combine subplot_mosaic with axes using various different projections (e.g. one rectilinear axes and one polar axes and one 3d axes) has been requested a few times (once in the original subplot_mosaic thread IIRC, and in #20392 too), and it's something I would recently have been happy to have, too.\r\n\r\nPushing projections directly into subplot_mosaic seems ripe for API bloat, but perhaps another solution would be to add `figure.gridspec_mosaic(...)` which takes the same arguments as subplot_mosaic, but returns a dict of *subplotspecs*, such that one can do something like\r\n```\r\nspecs = fig.gridspec_mosaic(...)\r\nd = {\r\n \"foo\": fig.add_subplot(specs[\"foo\"], projection=...),\r\n \"bar\": fig.add_subplot(specs[\"bar\"], projection=...),\r\n ...\r\n}\r\n```\r\nAs a side point, I do find the repetition of `fig` in each call to add_subplot a bit jarring (as the underlying gridspec is bound to the figure, so that information is actually redundant). Back in #13280 I had proposed to add SubplotSpec.add_subplot() (adding to the figure to which the gridspec is bound), which would allow one to write, here,\r\n```\r\nspecs = fig.gridspec_mosaic(...)\r\nd = {\r\n \"foo\": specs[\"foo\"].add_subplot(projection=...),\r\n \"bar\": specs[\"bar\"].add_subplot(projection=...),\r\n ...\r\n}\r\n```\r\nbut that idea got shot down back then and even if we decide not to revisit it, even the first form would be nice to have.\r\n\r\nThoughts?\n\n### Proposed solution\n\n_No response_","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2022-11-30T22:25:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/24571/matplotlib/issues/24571"}
| 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:551e2493-3284-4428-64e7-5c3931e10d1d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F9C:290D1F:211CCA0:2D4FC2D:6A5393A0 |
| html-safe-nonce | ba5eae7172d1ca9d34f56077dd343c7535f6d45fbeb9a9af4b87383e74d7c9e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjlDOjI5MEQxRjoyMTFDQ0EwOjJENEZDMkQ6NkE1MzkzQTAiLCJ2aXNpdG9yX2lkIjoiNDUzNjMxNjAyNzEzNTU2MjY1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e8408aa7ed21aba505e168e77dd3dd98f15a5ad80a2a1a799d9023ae94674076 |
| hovercard-subject-tag | issue:1470298920 |
| 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/24571/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d7dffe11fbcf3c254284c316aaa8ce1c7cfa089b97c08aa52367e050851c29e/matplotlib/matplotlib/issues/24571 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d7dffe11fbcf3c254284c316aaa8ce1c7cfa089b97c08aa52367e050851c29e/matplotlib/matplotlib/issues/24571 |
| og:image:alt | Problem Trying to combine subplot_mosaic with axes using various different projections (e.g. one rectilinear axes and one polar axes and one 3d axes) has been requested a few times (once in the ori... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| 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