plot
plot copied to clipboard
plot/palette: Allow Radial to set the critical index
It's common to want a specific diverging point in a radial map. For example, 0 may be a critical value in many applications, or 1 in aerospace applications for the Mach number. It would be nice to have a construction provided that allows that.
I don't think this is the responsibility of palette. Note that palette.Diverging is an interface, so the user can define any type of colour mapping symmetry. The actual mapping of data values to colours happens in the plotter that is rendering the value-colour relationship. So to a diverging palette around a defined value (0 or 1 as per the example), the Min and Max values of the plotter can be set to so that the desired origin lies half way between them. Am I missing something here? It seems to me that loading the responsibility onto the palette types excessively parameterises those types.
I meant the modifying the Radial function within palette, or providing a second function similar to it.
What would that look like and how would the information propagate to the plotter (at the moment the critical value is not used by any plotter)?
I see. I didn't sufficiently understand how it worked. I'll ponder.
When I did this with my own implementation in the past, I set the critical value, and inferred the min/max from the data. There was then an individual interpolation on either end.
A pull request I'm currently working on has this ability built in for different type of diverging color maps. See here.