A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel Smith and Stéfan van der Walt

Enthought15 HN recommenders · 2015–2026
177K views · talk · evergreen · Uploaded 2015-07-08

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.

Watch on YouTube

20 comments from Hacker News

@icegreentea2015 · in “Digital colours and digital photography”

Funny, I just watched a Scipy conference talk/video about this - it's about finding a new default color map for matplotlib [1] CIE LAB is basically a ~30 year old model based on human perception - basically it takes into account white point adjustment and the non-linear human brightness response, and thats about it. There are newer (and faaar more complicated) models like CIECAM02. [1] [VIDEO]

@elsherbini2016 · in “HCL: a color model that actually matches our perceptions (2011)”

This talk from the matplotlib people on making a better color map goes into some details about physical perception and what it means for picking colors: [VIDEO]

RecommendsView on HN
@vanderZwan2017 · in “Sorting Algorithms Revisualized”

There is the cube-helix approach, but I suspect you're thinking about something else. The linked talk about the creation of the viridis colour map[0] actually spends a good ten minutes on explaining colour theory, and makes it look very simple in the process. About ten minutes in it shows the "perceptual colour space" of a typical non-colourblind person. A few minutes later it shows the color spaces for people with various types of colourblindness. Perhaps one could project one perceptual space into the other in a way that more-or-less preserves the original information, but essentially with more banding? [0] [VIDEO]

RecommendsView on HN
@memco2018 · in “Show HN: Automatic detection of non-colorblind safe colors”

Your comment reminded me of the talks on the issue of information display for Matplotlib[0][1]. I think a lot of design is done without awareness of accessibility and this is more broadly a cultural thing than a technical thing. The situation can be improved both by technical means (OS or hardware awareness) as well as by our collective education about what kinds of issues designs should consider. Typically, designs become better when they account for accessibility, but it is oftentimes seen as a hurdle when a designer or developer has not heard about the issues and also is not equipped with tools to handle them. Having good tools is helpful here. The situation seems to be improving, but it will take time. When I was in elementary school, you had to special order large print text books, audio books were available, but required special tapes & players. A portable CCTV could be used to magnify small print. All of this equipment was specialized, expensive and hard to come by for most people. All of this has been replaced by features built into my phone. Special shoutouts to the "Zoom" app on iOS, that thing has color filters for people with color sensitivity issues and enhanced text rendering for small print (unfortunately, it's buggy and crashes sometimes), but it is much better than littering my camera roll with random pictures of menus or the bottom of routers just so I can zoom in on some numbers. [0] [VIDEO] [1] [LINK]

@hprotagonist2018 · in “Color: From Hex codes to Eyeballs”

Color is way more fascinating than I had previously thought. A few years ago, i watched this pydata talk on designing colormaps for matplotlib that was pretty engrossing: [VIDEO]

RecommendsView on HN
@vitalique2018 · in “New Map Scale Is More Readable by People Who Are Color Blind”

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] [VIDEO]

Strongly recommendsView on HN
@cosmic_quanta2018 · in “Ask HN: What are some of the best technical talks you've heard?”

A Better Default Colormap for Matplotlib ( [VIDEO] ) This talk is made better by the fact that it's rather brief (~20min).

RecommendsView on HN
@Mizza2019 · in “Unveiling the first-ever image of a black hole [video]”

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: [VIDEO]

Strongly recommendsView on HN
@no_identd2019 · in “Please don’t theme our apps”

The color change-inducing-friction complaint seems like an issue with lack of built-in theme sanity checking. There exist numerous partial solutions for this already, I'll link to the four best ones I know, albeit I wish someone would combine their approaches into one unified super-product: 1. [LINK] These palettes will absolutely NEVER clash. But they might have contrast issues. Which brings us to: 2. [LINK] Lyft primarily designed ColorBox.io to always reach WCAG 2.0 contrast ratios. Something I'd claim a ton of UX themes mess up. Unfortunately from what I can tell, it lacks the anti-clash guarantees of #1 3. Much less related, but still important, albeit only for very specific parts of any UX: The color map generation approach in Matplotlib: [VIDEO] (btw.: Seaborn, as mentioned in #1, builds on top of Matplotlib.) For even more color madness, see this recent Hacker News comment by me as well as the other comments linked to there: [LINK]

@kbd2019 · in “Turbo, an Improved Rainbow Colormap for Visualization”

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: [VIDEO] I'd love to see Turbo analyzed in the same fashion.

Strongly recommendsView on HN
@spectramax2019 · in “Turbo, an Improved Rainbow Colormap for Visualization”

> 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: [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

Strongly recommendsView on HN
@neilpanchal2019 · in “Designing Accessible Color Systems”

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: [VIDEO]

Strongly recommendsView on HN
@azepoi2020 · in “How to Avoid Equidistant HSV Colors (2011)”

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 [VIDEO] (A Better Default Colormap for Matplotlib, SciPy 2015, Nathaniel Smith and Stéfan van der Walt). It is about perceptually uniform colormaps. [LINK]

Strongly recommendsView on HN
@steerablesafe2021 · in “Ditherpunk: The article I wish I had about monochrome image dithering”

> I don't get what you mean, linearity (dL'star') being defined wrt perceptual uniformity, isn't CIELAB 76 linear by definition (to an approximation) ?? And color arithmetic pretty much by definition implies dealing with distances and angles in a perceptually uniform color space, doesn't it ?? No. Linearity is about physical light intensities relating to perceived color. Imagine having two light sources on the same spot that you can turn on or off separately. If you turn the first one on you perceive a certain color, if you turn the other on you perceive an other color and if you turn both on you perceive a third one. It turns out the perceivable colors (under normal viewing conditions) are representable in a three dimensional vector-space (for most people) so that the first two colors add up to the third color for every possible two light sources. Such a linear colorspace is XYZ for example [1]. This has nothing to do with perceptual uniformity. Perceptual uniformity is about the capability of distinguishing near colors. This defines a distance between colors, and there are three dimensional colorspace representations where the Euclidean distance approximate this perceptual distance well. cieLAB is such a colorspace, but AFAIK there are better state of the art colorspaces for the same purpose. I'm not very well versed in this, I learned from them from this video [2]. [1] [LINK] [2] [VIDEO] edit: gimp 2.10 now defaults to use a linear colorspace (not perceptually uniform!) fo

@maliker2021 · in “Which color scale to use when visualizing data”

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] [VIDEO]

RecommendsView on HN
@CorrectHorseBat2021 · in “Rainbow Color Map Still Considered Harmful (2007) [pdf]”

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 [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).

RecommendsView on HN
@dwdz2022 · in “Benchmarking Malloc with Doom 3”

Please don't use Jet color scheme. Matplotlib uses excellent viridis by default. There's no reason not to use it. [0][1] [0] [LINK] [1] [VIDEO]

@quietbritishjim2023 · in “Why Japan Has Blue Traffic Lights Instead of Green”

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: [VIDEO] Here's a little article about it (with some R specifics): [LINK]

RecommendsView on HN
@qwertox2025 · in “Issues with color spaces and perceptual brightness”

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 [VIDEO]

RecommendsView on HN
@carpdiem2026 · in “Show HN: Ember – Redshift safe color palettes”

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: [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]

RecommendsView on HN