Maps with Measurement Uncertainty
This is an attempt at implementing uncertainty Visualisation with matplotlib. I want to show measured value and uncertainty in the same image, like here:
(their website is informative: http://spatial-analyst.net/wiki/index.php?title=Uncertainty_visualization )
Lets say we have this observation:
And the uncertainty increases from center to outside:
Here are some attempts:
This whitens with increasing error:
Cool color map:
This one grays out:
With viridis color map:
Some color maps do not work well, like Red-Blue. This is because the middle is too bright.
There are two axes: value is mapped to hue/color, and error should modify either lightness or saturation.
Modern colormaps are perceptually uniform. They increase the lightness/luma in lockstep with the color.
Here however we two independent axes, like here:
On the vertical axis are different colors. Towards the right, the image desaturates (with increasing uncertainty).
The nice thing about this approach is that in a black-and-white print-out, only one axis is lost (saturation), but the vertical axis (lightness) still goes with value.
Here is the same image, grayscaled:
Code can be found in https://github.com/JohannesBuchner/uncertaincolors/blob/master/uncertaincolors.py
Why not just map with HSV?
Initially I thought to just go to a colorspace such as JCh or HSV that have color (Hue H) and lightness or saturation as independent axes (V,J). This gives images like this one:
The arcs make the image useless. Colors here are not desaturized homogeneously.
Instead, the approach I chose is to select a colormap and get the initial values (at uncertainty 0) and find their saturation. I normalise the colormaps to the same saturation. The second axis then desaturates until no color is left.