Skip to content

Feature proposal: "Dark mode" divergent colormaps #18608

@martinosorb

Description

@martinosorb

Since version 2.0, matplotlib has done a good job encouraging users to use perceptually uniform colormaps, distinguishing between divergent and sequential colormaps, etc. In my job, I find divergent colormaps very useful; there is a good selection of them, but they all have a very light "zero" colour: typically white or yellow, except one which is light gray. They can be seen here. This is an example of what can be done:
light

With the explosion of "dark mode" in apps, websites and in the tastes of end-users, it would be very nice to have a divergent colormap that has a dark default colour.

Proposed Solution

To add two or more colormaps which fulfill all the conditions of divergent colormaps, but have a dark colour as a middle colour. At least one of these should use pure black.

Additional context and prior art

Currently, the closest approximation is plt.cmap.twilight, however, it does not look sufficiently symmetric to me. Moreover, it's cyclic, so it ends with the same colour on both sides, which is undesirable. This is how it looks like:
dark

It's quite close to what I'm suggesting, except for the details I mentioned above (and I would add one or two more, including at least one with a black background).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions