On colormaps

Problems with the (old) standard colormap in Matlab are widely known. Even MathWorks addressed this issue after changing the default colormap in this blog post. But there are several other sources that discuss this issue or provide better colormaps. Most of them just a short Google search away (e.g. here, here or here).

The de facto standard source for good colormaps is ColorBrewer developed by Cynthia Brewerbased on the research of Dr. Cynthia Brewer. To use these maps in Matlab, you can use BrewerMap by DrosteEffect.

To summarize some of the different colormaps, I chose some typical numerical results that I often have to visualize. These are visualized with different ColorBrewer maps, as well as with jet for comparison.

The first example is the checkerboard test case. A source is placed in the middle of the domain and emits radiation in a heterogeneous environment. As for all further pictures: everything is the same but the colormap. The checkerboard results are shown below.

Next up is the so called line-source problem. Imagine an infinitely long line along the z-axis emitting particles isotropically. The true solution is radially symmetric, but numerical schemes often suffer from undesired ray-effects. These effects might be over- or underrepresented, based on the different colormaps.

Another line-source solution (that is actually terrible as it looks nothing at all like the true solution) shows that some features are very hard to detect in the jet colormap.

Lastly, an analytical example. I placed a Gaussian distribution on a sphere with the argument of the Gaussian being the distance from a point to the north pole. This is a smooth function but jet shows artificial layers or rings that do not exist in the true solution. Here, I also used the Sequential 1 and Sequential 2 options for colormaps provided by BrewerMap / ColorBrewer.

Below is the same plot, but looking from above, jet shows very dominant “rings” that are not present in other colormaps.

Leave a Reply