Hot and cold colormap for diverging data
This started as a translation of Bipolar Colormap by Ged Ridgway into Python. The original had 4 different colormap regions:
- n < 0.0: Rainbow colormap
- n < 0.5: Diverging cyan - blue - dark - red - yellow
- n = 0.5: Sequential dark purple to bright yellow
- n > 0.5: Diverging blue - cyan - light - yellow - red
This only implements 2:
- n < 0.5: Diverging cyan - blue - dark - red - yellow
- n ≥ 0.5: Diverging blue - cyan - light - yellow - red
This is not a modern well-designed colormap; it's not perceptually uniform, does not have uniform lightness steps, and the endpoints are not equal lightness. But it looks nice for some purposes.
The original bipolar()
had "halos" (Mach bands?) from going out to the corners of the RGB cube and then making a right angle:
So I made a version with Bézier curves through the RGB cube that is smoother and gets rid of the prominent bands, and called it hotcold()
. I would recommend this be used instead of bipolar()
:
It's still not perceptually uniform, but improved. I think true perceptual uniformity (equally-spaced steps in perceptual colorspace) is overrated, but it would be nice to improve it to have uniform lightness steps, and maybe same-lightness endpoints.
Very similar colormap is FireIce by Joseph Kirk
Comparisons with other conceptually-similar maps from matplotlib, colorcet, and CMasher: