A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel Smith and Stéfan van der Walt
Enthought15 HN recommenders · recommended in 14 months, 2015–2026
talk · general · evergreen · 2015–2026 on HN
SciPy 2015 talk by Nathaniel Smith and Stefan van der Walt on choosing a new default colormap for Matplotlib. It covers why Jet misleads, how perceptual color spaces work, and how viridis was designed.
HN's go-to recommendation for colormap and color-perception questions; commenters call it funny, brief, clear and a favorite talk.
Up next
4 mo on HNRSA ANIMATE: Language as a Window into Human Nature
Royal Society of Arts
2 HN recommender · 2011–2022
7 mo on HNWhy Are You So Angry? Part 1: A Short History of Anita Sarkeesian
Innuendo Studios
7 HN recommender · 2015–2022
6 mo on HNThe Marvel Symphonic Universe
Every Frame a Painting
6 HN recommender · 2017–2026
9 mo on HNConfessions of a Converted Lecturer: Eric Mazur
UMBCtube
9 HN recommender · 2009–2023
4 mo on HNInteractive notebooks ~ Pluto.jl | Fons van der Plas | JuliaCon 2020
The Julia Programming Language
6 HN recommender · 2020–2021
4 mo on HNGeoffrey West on COMPLEXITY
FQxI
3 HN recommender · 2014–2018
5 mo on HN4 2 1 Christopher Domas The future of RE Dynamic Binary Visualization
Adrian Crenshaw
7 HN recommender · 2013–2026
3 mo on HNStanford Seminar: Beyond Floating Point: Next Generation Computer Arithmetic
Stanford Online
5 HN recommender · 2017–2021
12 mo on HNHans Rosling's 200 Countries, 200 Years, 4 Minutes - The Joy of Stats - BBC
BBC
10 HN recommender · 2010–2023
11 mo on HNDON'T PANIC — Hans Rosling showing the facts about population
Gapminder Foundation
8 HN recommender · 2017–2021
8 mo on HNWealth Inequality in America
politizane
8 HN recommender · 2013–2025
7 mo on HNAnimations of unseeable biology | Drew Berry | TED
TED
7 HN recommender · 2017–2025
12 comments from Hacker News
I'm impressed by the other mentioned picker, for HCL this time link This tool is also useful link I have to mention this fantastic presentation on colormaps ▶ this video (A Better Default Colormap for Matplotlib, SciPy 2015, Nathaniel Smith and Stéfan van der Walt). It is about perceptually uniform colormaps. link
I built similar perceptually uniform color library: link The sad part is that we have all these colors available in the physical world but representing in sRGB (or even Adobe RGB or DCI P3) space takes away all the fun. We have a narrow space to work within and it poses limits to what you can do. Vast majority of monitors in the world are barely capable of representing sRGB space, and even if they are, calibration is another issue. You can employ all kinds of science in representing proper colors but if the end user's calibration is not good, all bets are off. Colors are a problem for interface design (and accessibility), it becomes a real challenge when dealing with quantitative data and build perceptually uniform colormaps with accessibility considerations, here is an amazing presentation of Matplotlib's new colormaps: ▶ this video
If you have any interest in this topic, I’d strongly recommend watching this presentation at SciPy 2015 where Viridis and Inferno were first presented, when the developers of Matplotlib were coming up with a new default colormap to replace Jet: ▶ this video I'd love to see Turbo analyzed in the same fashion.
> Today we are happy to introduce Turbo, a new colormap that has the desirable properties of Jet while also addressing some of its shortcomings, such as false detail, banding and color blindness ambiguity. What are the desirable properties of Jet? Why not use Viridis or Magma or any of the recent linear colormaps from matplotlib 2.0? These shortcomings were the exact reason why Viridis was created as exemplified in this brilliant talk: ▶ this video I don't understand the point of Turbo. > Turbo mimics the lightness profile of Jet, going from low to high back down to low, without banding. As such, its lightness slope is generally double that of Viridis, allowing subtle changes to be more easily seen. This is a valuable feature, since it greatly enhances detail when color can be used to disambiguate the low and high ends. Why would anyone want low-to-high-to-low colormap? > Viridis is a linear color map that is generally recommended when false color is needed because it is pleasant to the eye and it fixes most issues with Jet. Inferno has the same linear properties of Viridis, but is higher contrast, making it better for picking out detail. However, some feel that it can be harsh on the eyes. While this isn’t a concern for publishing, it does affect people’s choice when they must spend extended periods examining visualizations. Personal taste vs scientific accuracy - I will take the latter unless we are doing plots for marketing materials. In my view this is not substantiated reason
Grrr, why aren't scientists all using perceptually uniforms color schemes! This would still look awesome in `plasma`. Is there any where I can get the data and do it myself? One of my favorite talks ever is on this subject: ▶ this video
I am not colorblind, but work with data visualization in Matlab a lot. This hilarious SciPy2015 talk[1] convinced me to switch to the Parula color scheme. There's no way I'm going back to Jet. [1] ▶ this video
That's a... surprisingly good question. I'm actually a physicist by background first, so I got my start doing waaayyy too many calculations with blackbody and emissions spectra. Then, back in 2010, when I was just getting into startups, I spent two weeks straight at Powell's in Portland reading through their graphic design section. After that, I never got very far away from light or perception... AR/VR -> graphics -> silicon photonics -> physical AI (now). I'm still very much learning, but if you like this stuff and want to learn more yourself there's a couple sources I can recommend: - Interaction of Color, by Josef Albers. Amazing book, but you really want to get a physical copy. - I really like this talk from SciPy 2015 to get a sense of how people work with and talk about color maps in practice: ▶ this video - This is a really, really thorough (and beautifully illustrated) article on what color spaces are: link - And last, I wrote a very technical blog post a few years back, if you want to see some math on a bunch of this: link
If this submission has put you into a mindset of wanting to know more about colormaps, here's a good video about how Matplotlib ended up having `vividris` as its default colormap: A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel Smith and Stéfan van der Walt ▶ this video
Depending on what exactly your figures were/are, you might benefit from the viridis colour map, available in matplotlib and R (and probably in many other places). It's colourful, so those without colour blindness get a richer display than if you used greyscale, and the colours chosen aren't too affected by most common forms of colour blindness. But for those that really can't see the colours, even if you literally just convert to monochrome, it still works. It also looks nice :-) Here's a talk by the creators: ▶ this video Here's a little article about it (with some R specifics): link
You're increasing the discriminability at the cost of high _local_ distortion, I don't see how that is a good tradeoff. As a comparison, what would you rather have: a non-distorted plot or a plot that is on average about three times as big, but it's heavily distorted. At some places it's smaller than the original and on other places it's 5 times bigger. Would you really choose the bigger figure? That is what jet is. Look at this plot ▶ this video (watch the whole video if you have the time), ideally you want the derivatives (the 2 plots on the left top) to be constant so not to distort your data. Jet is all over the place while viridis is basically constant (not shown in the slides, but the derivative stays all the way around 120).
There’s a great talk [1] on how SciPy chose their new default colormap viridis to replace the rainbow colored former default “jet”. Turns out that there have been good studies on how the wrong colormap can lead to bad decisions in medicine, and designing a replacement took a lot of careful work. [1] ▶ this video
A Better Default Colormap for Matplotlib ( ▶ this video ) This talk is made better by the fact that it's rather brief (~20min).