Title: `Normalize` should not need to define an `inverse()` method · Issue #7320 · matplotlib/matplotlib · GitHub
Open Graph Title: `Normalize` should not need to define an `inverse()` method · Issue #7320 · matplotlib/matplotlib
X Title: `Normalize` should not need to define an `inverse()` method · Issue #7320 · matplotlib/matplotlib
Description: The colors.Normalize class currently defines an inverse() method (http://matplotlib.org/devdocs/api/colors_api.html#matplotlib.colors.Normalize -- by the way it is not documented), which maps the normalized value (i.e., index into the co...
Open Graph Description: The colors.Normalize class currently defines an inverse() method (http://matplotlib.org/devdocs/api/colors_api.html#matplotlib.colors.Normalize -- by the way it is not documented), which maps the n...
X Description: The colors.Normalize class currently defines an inverse() method (http://matplotlib.org/devdocs/api/colors_api.html#matplotlib.colors.Normalize -- by the way it is not documented), which maps the n...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7320
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Normalize` should not need to define an `inverse()` method","articleBody":"The `colors.Normalize` class currently defines an `inverse()` method (http://matplotlib.org/devdocs/api/colors_api.html#matplotlib.colors.Normalize -- by the way it is not documented), which maps the normalized value (i.e., index into the colormap) back to image data value.\n\nIn practice this method is only used in one place: the colorbar is drawn by taking uniformly spaced points in normalized space, transform back into data space (at the end of `Colorbar._process_values()`), then later drawn by calling `pcolormesh` on such data values (applying the normalization back into normalized space). I guess the reason for this is that one may want to draw the colorbar using user-specified data values instead.\n\nHowever, this could just as easily be done by always working internally in normalized values: by default, just plot uniformly spaced normalized values; if the user specifies the values to use, just normalize them first.\n\nThe advantage of making such a change was highlighted to me by #7294, a PR which proposes supporting arbitrary normalization functions. While there are a number of other points I make in that PR, one issue is that this PR requires the user to specify both the normalization function and the inverse normalization function (in order to provide `inverse`). But, as mentioned above, with a fix to the way colorbars are drawn, there wouldn't be a requirement for the user to specify the inverse normalization (which may be nontrivial to compute).\n","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2016-10-21T07:40:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/7320/matplotlib/issues/7320"}
| 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:8d3ca124-bed8-7acc-5b90-51b3c8b52d5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C772:BFAF3:144A6DB:1BC4F06:6A522856 |
| html-safe-nonce | be7b5937962a203113141679ab43ffa25176f153183905f29eaee50e5d410222 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzcyOkJGQUYzOjE0NEE2REI6MUJDNEYwNjo2QTUyMjg1NiIsInZpc2l0b3JfaWQiOiI0NTM2MjYxMzIyMTM3MDIwNTAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2808ffe966bff72df0e31bcd9090c15da93b26076ff0279cc2107f1ae83bc43e |
| hovercard-subject-tag | issue:184419108 |
| 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/7320/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2fd25f3b74cfb4681dd488ced2a4aca37b561d08954c12c758fbaff783cf42c7/matplotlib/matplotlib/issues/7320 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2fd25f3b74cfb4681dd488ced2a4aca37b561d08954c12c758fbaff783cf42c7/matplotlib/matplotlib/issues/7320 |
| og:image:alt | The colors.Normalize class currently defines an inverse() method (http://matplotlib.org/devdocs/api/colors_api.html#matplotlib.colors.Normalize -- by the way it is not documented), which maps the n... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width