ENH: add to_grayscale() method to color maps#3589
ENH: add to_grayscale() method to color maps#3589jakevdp wants to merge 1 commit intomatplotlib:masterfrom
Conversation
|
👍 looks good to me |
|
I am -1 in its current form. I think it would be misleading to call it Also, what about other grayscale conversions? Imagemagick has a good On Sun, Sep 28, 2014 at 10:49 PM, Thomas A Caswell <notifications@github.com
|
|
I think the approach in #3279 is preferable, since it converts everything in the image, not just colormapped items, to greyscale, and additionally adds some color-blindness-simulation transformations. |
|
@WeatherGod – the point here is not to simply use a grayscale color map. The point is to see how your color figure will look if it is to be printed as black and white (and to provide an easy utility to show people how bad I hadn't seen #3279, but I agree it's preferable to this approach. |
This PR adds a method to the
Colormapbase class which computes and returns a grayscale version of the map. This helps to quickly preview how various colormaps will appear when printed in grayscale.This uses the same formula as photoshop's grayscale conversion; see http://alienryderflex.com/hsp.html for details.
As an example of the usage, we can quickly demonstrate one reason why everybody loves to rag on jet:
I'm open to any suggestions or comments! I'm not sure if there are any complications with corner cases that I might be overlooking...