Issue 071 – November 6, 2021

CFD Colour Maps

Hey there,

It’s Robin from CFD Engine & don’t worry this isn’t going to be a rant about the evils of the rainbow colour map 🌈

It started life as a note on how to make-your-own colour maps but, whilst doing some background reading (yes, some research goes into this) it morphed into why you probably shouldn’t be making your own colour maps after all.

So instead I’ll share some great resources on colour for visualisation, my key takeaways from reading around and a handful of tools for better colour maps.

I’ll do a Part 2 on manipulating colour maps in ParaView, but consider this the foundation material.

Background

I was vaguely aware that rainbows are for unicorns and not for scientific visualisation, but I wasn’t aware how deep you can go with this stuff & just how much is at play in the design of a good colour map.

There’s so much going on that it can get a bit intimidating, thankfully I tripped over some useful articles that were both informative & approachable, even for a noob like me.

The gateway to this adventure was the excellent Datawrapper blog, especially their Colour in data vis collection (I linked to them in the past when I was discussing dashboards).

In particular, I want to signpost their four-part series on “Which colour scale to use when visualizing data”, plus their “friendly guide to colours in data visualisation” – all worth a spot on your reading list.

The result of my reading around this subject was a realisation that I know almost nothing about colour maps 😳 Here’s the gist of what I did manage to pick up.

The Headlines

Firstly, the two main things that stopped me from recommending you make your own colour maps were:

  1. Making good colour maps is hard work – a lot of hard work;
  2. ParaView already has 126 of them – do you really need another one?

More general takeaways included…

  • Lightness is important – it’s easier to understand the significance/sequence of the colours in a map when there is a smooth variation in lightness between them.
  • Shading is important – if you’re going to apply a colour map to a 3D surface (& we are) then it shouldn’t obscure the shape information provided by the shading/shadows (i.e. avoid maps with very dark colours in them)
  • Where you put your colour stops matters – you can really bring out the nuances in your data by compressing certain regions of your colour map, the colours don’t have to be uniformly distributed across your range.
  • I like diverging maps – great for highlighting the variation about a particular value e.g showing positive & negative variation in Cp, centred about zero.
  • I like discrete colour bands – this one might not be popular, but I find it easier to spot where things have changed if I’m comparing plots that use discrete/banded colour maps.
  • Single-hue maps – I’ve always overlooked single-hue maps (greyscale is the simplest example) but maybe they’re more useful than I gave them credit for, especially if you have sharp gradients, eg. density contours / Schlieren plots 🤩
  • Colour Blindness – I’d never considered that a client might have an issue seeing certain colours, or how that could impact their perception of the plots I make. It’s relatively easy to account for, so I’ll factor it into my next colour map choice.
  • Muscle memory – if a client has a history of reading plots in a particular colour map (i.e. “red is fast” or “blue is bad”) then I need to think carefully before increasing their cognitive load by changing to a new scheme.
  • Rainbows aren’t all bad… but, if your plot is mostly bright green, then you’re doing it wrong.

Resources

I tripped over a lot of other useful colour-related resources too, here are my top four:

TL;DR

I went down the colour map rabbit hole so you don’t have to – summarised in three sentences, I suggest that you…

“Don’t use rainbow colour maps unless you have to”

“Don’t make your own colour maps”

“Try some of the other maps in ParaView & see which ones make your data look great”

I’m now slightly fascinated by this stuff, so drop me a note if you have any cool resources that I need to see or send me the before/after images of your colour map swaps.

Until next week, stay safe,

Signed Robin K