Title: Add ability to pass different kwargs when adding different subplots simultaneously through`plt.subplots` · Issue #20392 · matplotlib/matplotlib · GitHub
Open Graph Title: Add ability to pass different kwargs when adding different subplots simultaneously through`plt.subplots` · Issue #20392 · matplotlib/matplotlib
X Title: Add ability to pass different kwargs when adding different subplots simultaneously through`plt.subplots` · Issue #20392 · matplotlib/matplotlib
Description: Problem I was just messing aroung with trying to see if I could use the (super nice!) plt.subplot_mosaic function with a mixture of 2d and 3d axes, but didn't get anywhere. Looking into it, it seems like it could be possible with subplot...
Open Graph Description: Problem I was just messing aroung with trying to see if I could use the (super nice!) plt.subplot_mosaic function with a mixture of 2d and 3d axes, but didn't get anywhere. Looking into it, it seem...
X Description: Problem I was just messing aroung with trying to see if I could use the (super nice!) plt.subplot_mosaic function with a mixture of 2d and 3d axes, but didn't get anywhere. Looking into it, it ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/20392
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add ability to pass different kwargs when adding different subplots simultaneously through`plt.subplots`","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 was just messing aroung with trying to see if I could use the (super nice!) `plt.subplot_mosaic` function with a mixture of 2d and 3d axes, but didn't get anywhere. Looking into it, it seems like it could be possible with `subplot_kw = {\"projection\": \"3d\"}`, but this is static across the different subplots (or more accurately, calls to `plt.add_subplot`).\r\n\r\n\r\n### Proposed Solution\r\n\r\nFrom looking at the source code (specifically at these line in `gridspec.py`, since that's where I believe the function calls eventually end up) it seems like it may be possible to package `subplot_kw`s in an object of size `_nrows` x `_ncols`, since that is the dimensions iterated over.https://github.com/matplotlib/matplotlib/blob/9c530bce8d9c25afee831310382b98e01a96146f/lib/matplotlib/gridspec.py#L299-L308\r\n\r\nThe only part that's unclear to me from an implementation standpoint is whether this would necessitate a new kwarg itself, or perhaps one can use single dispatch or conditional logic to handle the case where `subplot_kw` is not dict-like.\r\n\r\nHappy to have a go if this is desired and/or the functionality exists already and I'm blindsighted to it :)\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\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\nCould be many scenarios where one would want to control each subplot! I think it would be super neat to be able to do all this from one call to `plt.subplots` :D\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","author":{"url":"https://github.com/phinate","@type":"Person","name":"phinate"},"datePublished":"2021-06-08T18:50:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/20392/matplotlib/issues/20392"}
| 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:2a351135-45d0-9bd8-eb8f-929a37ea6554 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB6C:25E8A1:195AE39:228B64D:6A53EDFB |
| html-safe-nonce | 3172f1565f57845ccfac1239662052d0e888c5819c4702e6622ec03355704cfa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjZDOjI1RThBMToxOTVBRTM5OjIyOEI2NEQ6NkE1M0VERkIiLCJ2aXNpdG9yX2lkIjoiNTYyMjQwMzgwMzM0NzQxNDUyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c8b7dc9e6f70f634ca9a5aadaf5ec2d289219f9591cc0ef53e0dcde913d8d152 |
| hovercard-subject-tag | issue:915354311 |
| 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/20392/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6736d624e53a99d97b3af2cf8369cf1f10c1f056b34a2f0e73c09a7d54b4200e/matplotlib/matplotlib/issues/20392 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6736d624e53a99d97b3af2cf8369cf1f10c1f056b34a2f0e73c09a7d54b4200e/matplotlib/matplotlib/issues/20392 |
| og:image:alt | Problem I was just messing aroung with trying to see if I could use the (super nice!) plt.subplot_mosaic function with a mixture of 2d and 3d axes, but didn't get anywhere. Looking into it, it seem... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | phinate |
| 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