Title: [ENH] Unit support for ScalarMappables · Issue #7383 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH] Unit support for ScalarMappables · Issue #7383 · matplotlib/matplotlib
X Title: [ENH] Unit support for ScalarMappables · Issue #7383 · matplotlib/matplotlib
Description: In #6934 (categorical colormapping), I'm trying to add support for imshow visualizing arrays of strings ('cause strings are data...) and then creating the associated colorbar and eventually a legend. What I've run headlong into (and has ...
Open Graph Description: In #6934 (categorical colormapping), I'm trying to add support for imshow visualizing arrays of strings ('cause strings are data...) and then creating the associated colorbar and eventually a legen...
X Description: In #6934 (categorical colormapping), I'm trying to add support for imshow visualizing arrays of strings ('cause strings are data...) and then creating the associated colorbar and eventually...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7383
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH] Unit support for ScalarMappables","articleBody":"In #6934 (categorical colormapping), I'm trying to add support for imshow visualizing arrays of strings ('cause strings are data...) and then creating the associated colorbar and eventually a legend. \r\nWhat I've run headlong into (and has created spaghetti code) is that imshow doesn't support unit conversions, which sort of makes sense as norms dictate how things should be colored but it also creates this weird circular dependencies of sorts on how the data gets coded when it's time to also set up the colorbars 'cause of how ticks/locators are done there (still super confused on all that). \r\n\r\nI'd really like to add that sort of \"unit\" knowledge to imshow (or its underlying object). \r\n\r\nThe plan is to:\r\n 1) extend the [AxisInfo](https://github.com/story645/matplotlib/blob/master/lib/matplotlib/units.py#L53) object in [units.py](https://github.com/story645/matplotlib/blob/master/lib/matplotlib/units.py#L26) with the default norm, colormap, and cbar locators/formatters or to create another object SMInfo or something that stores that info.\r\n\r\nEdit: Can't decide the name 'cause this is an issue for anything that takes a colorbar, which is both the AxesImage objects and stuff like scatter.\r\n2) use units in the underlying imshow code in the manner it's currently used in the plot code. \r\n\r\nI think this could also maybe be used to later refactor the colorbar code or norms or something. And possibly codifying what's the defaults for floats and ints and the like-basically unit becomes a stylesheet of sorts for data.\r\n","author":{"url":"https://github.com/story645","@type":"Person","name":"story645"},"datePublished":"2016-11-02T21:41:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/7383/matplotlib/issues/7383"}
| 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:024e0736-0135-4563-1e8a-9b1e77461e9b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C0E:2961A1:F6158:13F056:6A525A3C |
| html-safe-nonce | 42f3c5a3e451cda9ecd24c27f0dd35760dabbed624e86e9161420bf654ba1ba5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzBFOjI5NjFBMTpGNjE1ODoxM0YwNTY6NkE1MjVBM0MiLCJ2aXNpdG9yX2lkIjoiNTU0ODM5NDEzMzc4ODQ0OTM0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e2014a5dbf9ec7c929b6d132e4a6acf97f84e908f495f63a8b95880280d04911 |
| hovercard-subject-tag | issue:186927990 |
| 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/7383/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68b7c558662016f24a02e97c0fcec720c86cc0013de90195d8448296de5f9437/matplotlib/matplotlib/issues/7383 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68b7c558662016f24a02e97c0fcec720c86cc0013de90195d8448296de5f9437/matplotlib/matplotlib/issues/7383 |
| og:image:alt | In #6934 (categorical colormapping), I'm trying to add support for imshow visualizing arrays of strings ('cause strings are data...) and then creating the associated colorbar and eventually a legen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | story645 |
| 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