Title: Create independent option classes for each plotter class (Line2D, etc.) so as to ease integration in other libs · Issue #11044 · matplotlib/matplotlib · GitHub
Open Graph Title: Create independent option classes for each plotter class (Line2D, etc.) so as to ease integration in other libs · Issue #11044 · matplotlib/matplotlib
X Title: Create independent option classes for each plotter class (Line2D, etc.) so as to ease integration in other libs · Issue #11044 · matplotlib/matplotlib
Description: This is a feature proposal, not a bug. Please let me know if this is not the right place to file it. It seems from the matplotlib version that I am using, that the list of valid plotting options are directly declared in their respective ...
Open Graph Description: This is a feature proposal, not a bug. Please let me know if this is not the right place to file it. It seems from the matplotlib version that I am using, that the list of valid plotting options ar...
X Description: This is a feature proposal, not a bug. Please let me know if this is not the right place to file it. It seems from the matplotlib version that I am using, that the list of valid plotting options ar...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11044
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create independent option classes for each plotter class (Line2D, etc.) so as to ease integration in other libs","articleBody":"This is a feature proposal, not a bug. Please let me know if this is not the right place to file it.\r\n\r\nIt seems from the matplotlib version that I am using, that the list of valid plotting options are directly declared in their respective plotter constructor, i.e. options for [Line2D](https://matplotlib.org/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D) are directly listed in the `Line2D` constructor. This makes it quite difficult for other libraries such as `pandas` to easily validate and/or specify the set of valid options accepted, leading to a 'rush to args completeness' (such as in [pandas.DataFrame.plot](http://pandas.pydata.org/pandas-docs/version/0.18/generated/pandas.DataFrame.plot.html)), and eventually to the 'giving up' option (the generic `kwds` argument at the end of the list, containing \"Options to pass to matplotlib plotting method\"). Users then stop getting any help from their IDE to get a list of valid options and description.\r\n\r\nThe absence of such objects makes it also more difficult to perform higher-level automation, such as reusing the same options (or part of the same options) for several plots in a row - which is actually the use case for `pandas.DataFrame.plot`.\r\n\r\nI think that a better way exist and is quite simple to do. It would require two steps:\r\n * for each plotter object, create an independent class containing the configuration options. For example `Line2DOptions` for `Line2D`. The constructor of `Line2D` would continue to accept all keyword arguments as usual but would in addition also accept an instance of `Line2DOptions` instead.\r\n * optionally, create a parent class `PlotterOptions` for all such options class, so that it is relatively easy to both retrieve all such options, and also for other libraries such as pandas to do some basic typechecking.\r\n\r\nFood for thoughts...","author":{"url":"https://github.com/smarie","@type":"Person","name":"smarie"},"datePublished":"2018-04-13T09:31:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/11044/matplotlib/issues/11044"}
| 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:34fa276e-41af-e3d7-5359-6c6009ca2509 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC98:B2444:4F58F52:6ED9818:6A50F8C3 |
| html-safe-nonce | 122ce552ce6e70ac62f1f85b7065a72b05cadc09e5d64bbc6d5ba42ae62dfeab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzk4OkIyNDQ0OjRGNThGNTI6NkVEOTgxODo2QTUwRjhDMyIsInZpc2l0b3JfaWQiOiI4NDE1NTA5MTIxNDIwMjk0MzM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | deb91386fd0a108fb7ec4fd9ecf995f746590671921a59a857a14f45d7c687d1 |
| hovercard-subject-tag | issue:314035155 |
| 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/11044/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f929e00b8817c885cde95f3038f81761fe70b112c36f7402826054f7121e949/matplotlib/matplotlib/issues/11044 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f929e00b8817c885cde95f3038f81761fe70b112c36f7402826054f7121e949/matplotlib/matplotlib/issues/11044 |
| og:image:alt | This is a feature proposal, not a bug. Please let me know if this is not the right place to file it. It seems from the matplotlib version that I am using, that the list of valid plotting options ar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | smarie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838 |
| 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 | 8d836581d020676cc0ef4a83cd2fe17e4af02c3d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width