Title: Better document Axes.set() · Issue #19884 · matplotlib/matplotlib · GitHub
Open Graph Title: Better document Axes.set() · Issue #19884 · matplotlib/matplotlib
X Title: Better document Axes.set() · Issue #19884 · matplotlib/matplotlib
Description: Problem The property batch setter is a nice way for a more compact configuration compared to various lines of ax.set_*() calls. (Note: using kwargs is quite common with other plotting libraries, so this approach seems generally appealing...
Open Graph Description: Problem The property batch setter is a nice way for a more compact configuration compared to various lines of ax.set_*() calls. (Note: using kwargs is quite common with other plotting libraries, so...
X Description: Problem The property batch setter is a nice way for a more compact configuration compared to various lines of ax.set_*() calls. (Note: using kwargs is quite common with other plotting libraries, so...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19884
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better document Axes.set()","articleBody":"### Problem\r\n\r\nThe property batch setter is a nice way for a more compact configuration compared to various lines of `ax.set_*()` calls.\r\n\r\n(Note: using kwargs is quite common with other plotting libraries, so this approach seems generally appealing).\r\n\r\n`Axes.set()` is essentially undocumented:\r\n\r\n- It doesn't show up in the API docs anymore https://matplotlib.org/devdocs/api/axes_api.html. It used to here https://matplotlib.org/3.2.2/api/axes_api.html#bulk-property-manipulation, but was removed as part of #14960.\r\n- Currently there is only https://matplotlib.org/devdocs/api/_as_gen/matplotlib.artist.Artist.set.html\r\n and that content is far too general and too abstract to be of any help.\r\n\r\n### Suggested Improvement\r\n\r\n- We should re-introduce `Axes.set` into the API docs.\r\n- That method needs a more approachable description than \"A property batch setter. Pass kwargs to set properties.\"\r\n- Ideally, the signature should be explicit and not `**kwargs`, which would enable completion. There are two possible ways of doing this:\r\n\r\n 1. Dynamically rewrite the signature.\r\n 2. Hard-code the signature and add a test, that the parameters match the available properties.\r\n\r\n The first one has the advantage that this would trivially expand to all artists.\r\n The second one has the advantage that we can easily specify a meaningful order. Since we rarely change the available properties, hard-coding with a test would be good enough.\r\n","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2021-04-06T20:11:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/19884/matplotlib/issues/19884"}
| 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:f6321f77-3b71-d982-43a2-36590b4fe0b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 962A:DCBCB:7388E:9D394:6A52603B |
| html-safe-nonce | 837111e23a8b677b3cfdc21a733232b7b4c14d80af0cc011aa8db3be356a2ff4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjJBOkRDQkNCOjczODhFOjlEMzk0OjZBNTI2MDNCIiwidmlzaXRvcl9pZCI6IjY0MDIxMjcxODU3NjM3ODY4MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ab9f7db8299c3fedf75815c1351cb1b4b5845745c5caf66d898c8177bc3d0280 |
| hovercard-subject-tag | issue:851774933 |
| 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/19884/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c62ba05bee53660d29562970bb465c138f7a05a85c06700db871f49061d9bb9/matplotlib/matplotlib/issues/19884 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c62ba05bee53660d29562970bb465c138f7a05a85c06700db871f49061d9bb9/matplotlib/matplotlib/issues/19884 |
| og:image:alt | Problem The property batch setter is a nice way for a more compact configuration compared to various lines of ax.set_*() calls. (Note: using kwargs is quite common with other plotting libraries, so... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width