Skip to content

endolith/bipolar-colormap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bipolar-colormap

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.

Removing halos

The original bipolar() had "halos" (Mach bands?) from going out to the corners of the RGB cube and then making a right angle:

bipolar with halos marked by arrows

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():

hotcold with no halos

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.

Examples

bipolar colormaps of 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 neutral

hotcold colormaps of 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 neutral

Similar

Very similar colormap is FireIce by Joseph Kirk

Comparisons with other conceptually-similar maps from matplotlib, colorcet, and CMasher:

bipolar colormap vs iceburn, redshift, bkr, bjr

bipolar colormap vs CET_D10, cwr, CET_D9, coolwarm, bwr, RdBu, seismic, fusion

Releases

No releases published

Packages

No packages published

Languages