plot icon indicating copy to clipboard operation
plot copied to clipboard

plot/palette: Allow Radial to set the critical index

Open btracey opened this issue 7 years ago • 5 comments

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.

btracey avatar Nov 16 '16 22:11 btracey

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.

kortschak avatar Nov 16 '16 23:11 kortschak

I meant the modifying the Radial function within palette, or providing a second function similar to it.

btracey avatar Nov 16 '16 23:11 btracey

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)?

kortschak avatar Nov 16 '16 23:11 kortschak

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.

btracey avatar Nov 16 '16 23:11 btracey

A pull request I'm currently working on has this ability built in for different type of diverging color maps. See here.

ctessum avatar Nov 16 '16 23:11 ctessum