Title: colormap generalization · Issue #18809 · matplotlib/matplotlib · GitHub
Open Graph Title: colormap generalization · Issue #18809 · matplotlib/matplotlib
X Title: colormap generalization · Issue #18809 · matplotlib/matplotlib
Description: Problem The current implementation of colormaps maps a 1D float interval onto a 1D color spectrum. Meaning, I can use a colormap to find the color that 'matches' a single float value. Sometimes, however, I'd like to get the color that ma...
Open Graph Description: Problem The current implementation of colormaps maps a 1D float interval onto a 1D color spectrum. Meaning, I can use a colormap to find the color that 'matches' a single float value. Sometimes, ho...
X Description: Problem The current implementation of colormaps maps a 1D float interval onto a 1D color spectrum. Meaning, I can use a colormap to find the color that 'matches' a single float value. Somet...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18809
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"colormap generalization","articleBody":"### Problem\r\n\r\nThe current implementation of colormaps maps a 1D float interval onto a 1D color spectrum. Meaning, I can use a colormap to find the color that 'matches' a **single** float value.\r\n\r\nSometimes, however, I'd like to get the color that matches a **pair** or **triplet** of float values. \r\n\r\nA use case: coloring locations on a city map, where the color for each location is calculated from 2 values: the time needed to get there by car, and the time needed to get there by public transport. Or, from 3 values, if the time needed to get there by bike is also included. In that case, the color could be picked from a color triangle like [this one](https://github.com/rwijtvliet/interpol/blob/master/img/cmap3_transport_full.png).\r\n\r\n### Proposed Solution\r\n\r\nI ran into this problem and created a solution here: [https://github.com/rwijtvliet/interpol](https://github.com/rwijtvliet/interpol).\r\n\r\nNow, please note I've only created this for myself and probably needs a lot of work to be able to get merged into `matplotlib`. For example, there is no unit tests whatsoever.\r\n\r\n### Proposed Way Forward\r\n\r\n1. A core developer has a look a the linked project to check out, what I mean, and to judge if this is something the `matplotlib` package would actually benefit from including. (The examples at the ends of the sections `ColorMap2` and `ColorMap3` in the readme are the best places to start to get an idea of what I mean.)\r\n2. If yes, someone probably has some suggestions regarding how to start on a PR for this feature. I'd gladly help to get this included into the project, but my coding skills are insufficient to do this without by myself.\r\n\r\nBut let's first see if this is deemed of interest. :)","author":{"url":"https://github.com/rwijtvliet","@type":"Person","name":"rwijtvliet"},"datePublished":"2020-10-25T22:43:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/18809/matplotlib/issues/18809"}
| 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:0d9a9926-cf71-fa47-f285-77b0af8d0a0f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C998:372744:11B9947:182F501:6A5215B1 |
| html-safe-nonce | 8f6f68999d2743eba88f5e8466c6d86a40236373dfb4d99e818cd37d76564a28 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTk4OjM3Mjc0NDoxMUI5OTQ3OjE4MkY1MDE6NkE1MjE1QjEiLCJ2aXNpdG9yX2lkIjoiODQwOTk1MjU0NjEzNTg3Mjk0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1fbb684da3f883a74a27dd6673baf2feeb8f341299e75a056a6ac49f10356ca3 |
| hovercard-subject-tag | issue:729132271 |
| 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/18809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ecbba1ef026f9a861eac93376f7e38e211f4733a15a36fcc879ab68a30b84323/matplotlib/matplotlib/issues/18809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ecbba1ef026f9a861eac93376f7e38e211f4733a15a36fcc879ab68a30b84323/matplotlib/matplotlib/issues/18809 |
| og:image:alt | Problem The current implementation of colormaps maps a 1D float interval onto a 1D color spectrum. Meaning, I can use a colormap to find the color that 'matches' a single float value. Sometimes, ho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rwijtvliet |
| 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