From: Lion K. <kri...@ge...> - 2014-11-24 09:45:32
|
Hi all, I was made aware of this thread and thought I’d share a notebook I recently made for a similar purpose: http://nbviewer.ipython.org/gist/krischer/d35096a9d3b6da5846a5 <http://nbviewer.ipython.org/gist/krischer/d35096a9d3b6da5846a5> (takes a while to load…) It attempts to “optimize" colormaps by defining optimality as having a linear lightness across the colormap in LAB color space. It is very simple and not a proper optimization procedure. It just goes to LAB space, sets the lightness to the target lightness, and goes back to sRGB space. This does not always work as the LAB color space is much bigger than the RGB one but in many cases it produces fairly good results. The nice thing about this is that the lightness range can be chosen so it is does not always have to be stark white or black at the ends and some hue can be preserved. I am not sure if some similar functionality is useful to include into matplotlib (I don’t really think so) but if yes, let me know and I’ll give it a try. I guess it could also be extended to optimize towards monotonic changes in hue. Cheers and all the best! Lion |