Open jwmerrill opened 9 years ago
Under the hood colormaps are just Bezier splines in LCHuv colorspace from one color to other so what you are asking is completely possible. Instead of using the colormap function that splices the continuous representation into parts, you can use the underlying functions and call the splines directly with what ever value you want.
It's currently easy to get a beautiful red-blue diverging colormap with, e.g. 20 colors by calling
I would like to be able to map a continuous variable (for definiteness, say it ranges from -1.0 to 1.0) into this map, but I don't currently see an easy way to do this. Basically what I'm asking for is the N → ∞ limit of
I haven't gotten completely to the bottom of the way things are currently implemented, but given that you can already specify different values for
N
, it seems like something close to such a function must already exist privately somewhere inside the implementation, and it would be nice to expose it.