Giter VIP home page Giter VIP logo

bipolar-colormap's Introduction

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

bipolar-colormap's People

Contributors

endolith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bipolar-colormap's Issues

Grayscale-friendly at 0.5

Original had greyscale-friendly colormap at 0.5, but this doesn't,
right? Convert that, too, but under a separate name and update docs and docstring example?

Not perceptually uniform

matplotlib/matplotlib#6033 (comment)

bipolar Lab

Maybe acceptable anyway?

On the one hand, it should be possible to directly imitate the original MATLAB colormap, so perceptual uniformity would not be a goal in that case.

On the other hand, perceptual uniformity is nice.

But on the third hand, for this map, only perceptual luminance uniformity should be the goal, not hue or chroma. Trying to make each step equidistant makes colormaps ugly.

But on the original hand, that should be a separate colormap to keep the MATLAB consistency available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.