Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Perceptions of matplotlib colormaps

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.

Kristen Thyng

July 10, 2014
Tweet

More Decks by Kristen Thyng

Other Decks in Science

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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 effectively
    Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 14 / 15

    View full-size slide

  22. Resources
    All around helpful information on colormaps:
    Matteo Niccoli: http://mycarta.wordpress.com/2012/05/29/the-
    rainbow-is-dead-long-live-the-rainbow-series-outline/
    Comparison of 7 methods of converting to grayscale:
    http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
    Color blindness: http://www.color-blindness.com
    Link to slides:
    https://github.com/dmcdougall/scipy14-colormaps
    Kristen M. Thyng (Texas A&M) SciPy 2014 July 10, 2014 15 / 15

    View full-size slide