sjmgarnier / viridis

Colorblind-Friendly Color Maps for R
http://sjmgarnier.github.io/viridis
Other
295 stars 38 forks source link

Why are the default values for viridis 'light is more'? #76

Closed benmarwick closed 3 years ago

benmarwick commented 3 years ago

Why are the default values for viridis 'light is more', when the 'dark is more' bias (darker colors map to larger quantities) is so well documented (e.g. 1, 2, 3, 4). Some recent guidance suggests that 'light is more' is only suitable when the background in dark (which is usually isn't with ggplot2). I'm asking because I'm looking to justify my response to a journal editor who asks that I reverse the default viridis colour scale for all the figures in my manuscript (preprint is here). Thank you!

sjmgarnier commented 3 years ago

@benmarwick This is an excellent question. The reason why the R package is set up this way is to match the output of the Python equivalents from where the color palettes originated. However, I do not know what the rationale is behind the choice of the palette creators. This is a question for @stefanv and @njsmith I think. My guess is that it has to do with matching the variable value to the luminance scale but I could be completely wrong.

In any case, reversing the order of the scale is very easy with direction=-1.

stefanv commented 3 years ago

Colormaps should present quantities intuitively, but intuition varies depending on context. E.g., in a temperature map you expect white to be hot, because that's what happens when you heat things up. If you look at the ocean depth, you expect darker areas to represent greater values. See, e.g., https://matplotlib.org/cmocean/ Matplotlib provides all colormaps in reverse with the _r postfix, so viridis_r is the reverse of viridis.

Imagine the paper being printed out black & white, and then determine which direction would make most sense.

Maybe the most relevant concern here is the happiness of your editor!

sjmgarnier commented 3 years ago

My intuition is that reviewer 3 is never happy.

benmarwick commented 3 years ago

Thanks very much for your quick replies, I'll paraphrase @stefanv in my reply to the editor. Your phrase 'intuition varies depending on context' is especially helpful. Thanks again!

privefl commented 3 years ago

I had the same question, as I tend to use direction = -1 whenever I use viridis.