Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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' asingle float value.
Sometimes, however, I'd like to get the color that matches apair ortriplet of float values.
A 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 likethis one.
Proposed Solution
I ran into this problem and created a solution here:https://github.com/rwijtvliet/interpol.
Now, please note I've only created this for myself and probably needs a lot of work to be able to get merged intomatplotlib
. For example, there is no unit tests whatsoever.
Proposed Way Forward
- 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 sectionsColorMap2
andColorMap3
in the readme are the best places to start to get an idea of what I mean.) - 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.
But let's first see if this is deemed of interest. :)