Title: Support simple axes shares in subplot_mosaic · Issue #18305 · matplotlib/matplotlib · GitHub
Open Graph Title: Support simple axes shares in subplot_mosaic · Issue #18305 · matplotlib/matplotlib
X Title: Support simple axes shares in subplot_mosaic · Issue #18305 · matplotlib/matplotlib
Description: Problem I realized that subplot_mosaic() is quite nice even to create single row or single column layouts if you were previously going to stuff the result of subplots() in a dict anyways (or use hardcoded indices, in which case a dict ma...
Open Graph Description: Problem I realized that subplot_mosaic() is quite nice even to create single row or single column layouts if you were previously going to stuff the result of subplots() in a dict anyways (or use ha...
X Description: Problem I realized that subplot_mosaic() is quite nice even to create single row or single column layouts if you were previously going to stuff the result of subplots() in a dict anyways (or use ha...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18305
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support simple axes shares in subplot_mosaic","articleBody":"\u003c!--\r\nWelcome! Thanks for thinking of a way to improve Matplotlib.\r\n\r\n\r\nBefore creating a new feature request please search the issues for relevant feature requests.\r\n--\u003e\r\n\r\n### Problem\r\n\r\nI realized that `subplot_mosaic()` is quite nice even to create single row or single column layouts if you were previously going to stuff the result of `subplots()` in a dict anyways (or use hardcoded indices, in which case a dict may be more robust if you may (in some later iteration of the code) add axes somewhere in the middle).\r\n\r\n(Side points: Also, this avoids running into the subtle bug, when writing `axs = subplots(n)`, of the case `n = 1` where `axs` is squeezed into a single axes (yes, I know, the fix is to pass `squeeze=False`...) Single column is slightly trickier than single row (`subplot_mosaic([[name] for name in names])`) but heh.).\r\n\r\nHowever, `subplot_mosaic()` does not allow axes sharing. Yes, I've even argued against it in the original PR on the grounds of \"too complicated\" (https://github.com/matplotlib/matplotlib/pull/16603#issuecomment-593006244)...\r\n\r\n\u003c!--\r\nProvide a clear and concise description of the problem this feature will solve. \r\n\r\nFor example:\r\n* I'm always frustrated when [...] because [...]\r\n* I would like it if [...] happened when I [...] because [...]\r\n* Here is a sample image of what I am asking for [...]\r\n--\u003e\r\n\r\n### Proposed Solution\r\n\r\n... but we could at least support the simplest case(s), as in `subplots()`: `sharex/sharey=True/\"all\"` (this is completely unambiguous: share all axes -- \"all\" is a synonym from `subplots()` that we probably want to keep for consistency), and *possibly* `\"row\"`/`\"col\"` (I'd say two axes (which may have various spans) are in the same row for sharing purposes if they both *begin* on the same row and *end* on the same row, which seems the most useful definition)? We should be careful, when checking for True, to actually check for that value (or 1, or np.bool(True)), and not for general truthiness, so that we don't get boxed in later if we decide we *do* want to support passing in complex sharing specs (e.g. via dicts, as proposed in the original PR thread). (I'm still against that complexity, at least for now...)\r\n\r\nLabeling as good first issue as I don't think there's too much complexity or API design space here, although we still need to decide whether this is a good idea or not.\r\n\r\n\u003c!-- Provide a clear and concise description of a way to accomplish what you want. For example:\r\n\r\n* Add an option so that when [...] [...] will happen\r\n --\u003e\r\n\r\n### Additional context and prior art\r\n\r\n\u003c!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example:\r\n\r\n* Another project [...] solved this by [...]\r\n--\u003e\r\n","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2020-08-20T09:50:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/18305/matplotlib/issues/18305"}
| 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:7c668c21-643c-f8aa-56f3-6131c1648e4e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAE6:25EC2E:413D3C:55CE9D:6A52FB79 |
| html-safe-nonce | d9a8fdfd8a61827be6e9b9c4c25e83688cf0260961e4565310472d63aee56d62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUU2OjI1RUMyRTo0MTNEM0M6NTVDRTlEOjZBNTJGQjc5IiwidmlzaXRvcl9pZCI6IjY5NDIwNDgyNjMyNzgzNjE0NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c044610be2c2a01673ec75702168e999b2e1a37e6446a0b93fffd94763e1a9ba |
| hovercard-subject-tag | issue:682579573 |
| 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/18305/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af7f84cd5621a94ab9366026a0047481d406558076115ef4a18cc4eec67b3a35/matplotlib/matplotlib/issues/18305 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af7f84cd5621a94ab9366026a0047481d406558076115ef4a18cc4eec67b3a35/matplotlib/matplotlib/issues/18305 |
| og:image:alt | Problem I realized that subplot_mosaic() is quite nice even to create single row or single column layouts if you were previously going to stuff the result of subplots() in a dict anyways (or use ha... |
| 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