Title: [MNT]: Colormaps odd behavior (1 != 1.0) · Issue #28198 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: Colormaps odd behavior (1 != 1.0) · Issue #28198 · matplotlib/matplotlib
X Title: [MNT]: Colormaps odd behavior (1 != 1.0) · Issue #28198 · matplotlib/matplotlib
Description: Summary I encountered some unexpected behavior while usingn matplotlib.colormaps. Apparently, a_colormap(1) outputs the wrong result. The color it produces is indistinguishable from a_colormap(0), although it is slightly different. a_col...
Open Graph Description: Summary I encountered some unexpected behavior while usingn matplotlib.colormaps. Apparently, a_colormap(1) outputs the wrong result. The color it produces is indistinguishable from a_colormap(0), ...
X Description: Summary I encountered some unexpected behavior while usingn matplotlib.colormaps. Apparently, a_colormap(1) outputs the wrong result. The color it produces is indistinguishable from a_colormap(0), ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28198
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Colormaps odd behavior (1 != 1.0)","articleBody":"### Summary\r\n\r\nI encountered some unexpected behavior while usingn `matplotlib.colormaps`. Apparently, `a_colormap(1)` outputs the wrong result. The color it produces is indistinguishable from `a_colormap(0)`, although it is slightly different. `a_colormap(1.0)` produces the correct result, but `a_colormap(1.0) != a_colormap(1)`.\r\n\r\nWhat is going on? It would be useful to clarify this in the [docs](https://matplotlib.org/stable/users/explain/colors/colormapnorms.html).\r\n\r\n**Example**\r\n```python\r\nfrom matplotlib import colors, colormaps\r\nimport matplotlib.pyplot as plt\r\n\r\nprint(colors.to_hex(colormaps[\"binary\"](0)), colors.to_hex(colormaps[\"binary\"](1.0)))\r\nprint(colors.to_hex(colormaps[\"binary\"](0)), colors.to_hex(colormaps[\"binary\"](1)))\r\n```\r\n\r\n**Output**\r\n```\r\n#ffffff #000000\r\n#ffffff #fefefe\r\n```\r\n\r\n### Proposed fix\r\n\r\nImproved documentation, or added consistency to make integer values work for the upper endpoint.","author":{"url":"https://github.com/aaronshenhao","@type":"Person","name":"aaronshenhao"},"datePublished":"2024-05-09T13:09:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/28198/matplotlib/issues/28198"}
| 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:18687c0b-9920-35b6-ff55-2eaa43aa62f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D22:3614ED:2551231:31768F5:6A5209AD |
| html-safe-nonce | db483951237821afa80d822a30c7cf71a2aecf1d0222017572d7144f9e7a9bb6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDIyOjM2MTRFRDoyNTUxMjMxOjMxNzY4RjU6NkE1MjA5QUQiLCJ2aXNpdG9yX2lkIjoiNjkzODIyOTU5NDk3MDUyNDA3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 18c5a03dfad9ac44753172e15c84957879d9861a38c4d7588981dd996a636f7b |
| hovercard-subject-tag | issue:2287664815 |
| 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/28198/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f73da22ef7eb5d91a8f20dc6042a20dd4dc6e0a8f0d32d0b841ee6658284b36/matplotlib/matplotlib/issues/28198 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f73da22ef7eb5d91a8f20dc6042a20dd4dc6e0a8f0d32d0b841ee6658284b36/matplotlib/matplotlib/issues/28198 |
| og:image:alt | Summary I encountered some unexpected behavior while usingn matplotlib.colormaps. Apparently, a_colormap(1) outputs the wrong result. The color it produces is indistinguishable from a_colormap(0), ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aaronshenhao |
| 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