Kristen Thyng
July 10, 2014
1.9k

# Perceptions of matplotlib colormaps

A look at which matplotlib colormaps are most perceptual, as well as which will print well to grayscale and be accessible to viewers with color deficiencies.

July 10, 2014

## Transcript

1. Perceptions of matplotlib colormaps
Kristen M. Thyng
Texas A&M University
July 10, 2014
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 1 / 15

2. CIELAB Color Model
http://eschicleypega.blogspot.com
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 2 / 15

3. Lightness of matplotlib Colormaps
http://matplotlib.org/examples/color/colormaps reference.html
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 3 / 15

4. Lightness of matplotlib Colormaps
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 3 / 15

5. Lightness of matplotlib Colormaps
http://matplotlib.org/examples/color/colormaps reference.html
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 4 / 15

6. Lightness of matplotlib Colormaps
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 4 / 15

7. Perceived Lightness: Weber-Fechner Law (and Stevens)
1
1
2
2
3
4
4
8
Albers, J. (1975). Interaction of color. Yale University Press.
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 5 / 15

8. Improvement to Binary Colormap?
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 6 / 15

9. Improvement to Binary Colormap?
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 6 / 15

10. Printing to Grayscale
Lots of ways to convert to grayscale
Gray = (Red * 0.2126 + Green * 0.7152 + Blue *
0.0722) (or similar∗)
Use luminance
∗ http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 7 / 15

11. matplotlib Colormaps in Grey Scale
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 8 / 15

12. matplotlib Colormaps in Grey Scale
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 8 / 15

13. matplotlib Colormaps in Grey Scale
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 8 / 15

14. matplotlib Colormaps in Grey Scale
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 8 / 15

15. matplotlib Colormaps in Grey Scale
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 8 / 15

16. Color Blindness
Protanopia (2% male population, half mild form)
Deuteranopia (6% male population, mostly mild form)
http://www.color-blindness.com
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 9 / 15

17. Color Blindness
http://aspnetresources.com/tools/colorBlindness
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 10 / 15

18. Color Blindness
http://aspnetresources.com/tools/colorBlindness
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 11 / 15

19. Color Blindness
http://aspnetresources.com/tools/colorBlindness
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 12 / 15

20. Color Blindness
http://aspnetresources.com/tools/colorBlindness
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 13 / 15

21. Recommendations
Best colormap depends on application, but for form information,
perceptual colormaps are best
Perceptual colormaps monotonically increase with lightness
Not clear (to me) what functional relationship with L is best
Many ways to convert to grayscale — luminance is a good proxy to
decide on a good map
Most common color blindness problem is red-green — try to avoid for
reaching audiences most eﬀectively
Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 14 / 15

22. Resources
All around helpful information on colormaps:
Matteo Niccoli: http://mycarta.wordpress.com/2012/05/29/the-