Need help with CMasher?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

228 Stars 15 Forks BSD 3-Clause "New" or "Revised" License 238 Commits 3 Opened issues


Scientific colormaps for making accessible, informative and 'cmashing' plots

Services available


Need anything else?

Contributors list

# 282,052
Data vi...
212 commits
# 79
4 commits
# 351,284
1 commit

|PyPI| |conda-forge| |Python| |GitHub| |Coverage| |JOSS|

CMasher: Scientific colormaps for making accessible, informative and cmashing plots

The CMasher package provides a collection of scientific colormaps and utility functions to be used by different Python packages and projects, mainly in combination with

, showcased in the
online documentation
(where I also describe how to use the colormaps in other languages and applications). The colormaps in CMasher are all designed to be perceptually uniform sequential using the
_ package; most of them are color-vision deficiency friendly; and they cover a wide range of different color combinations to accommodate for most applications. It offers several alternatives to commonly used colormaps, like chroma and rainforest for jet; sunburst for hot; neutral for binary; and fusion and redshift for coolwarm. If you cannot find your ideal colormap, then please open an
_, provide the colors and/or style you want, and I will try to create one to your liking! Let's get rid of all bad colormaps in the world together!

If you use CMasher for your work, then please star the repo, such that I can keep track of how many users it has and more easily raise awareness of bad colormaps. Additionally, if you use CMasher as part of your workflow in a scientific publication, please consider citing the CMasher paper (BibTeX:


.. _issue: .. _online documentation: .. _matplotlib: .. _viscm:

Colormap overview

Below is an overview of all the colormaps that are currently in CMasher (made with the

function). For more information, see the
online documentation

.. image:: :width: 100% :align: center :target: :alt: CMasher Colormap Overview

In the figure, one can see this wide range of color combinations that CMasher has to offer, as I wanted to make sure that CMasher has a colormap for everyone. Because of this, CMasher's sequential colormaps range from single major color maps like amber; ember; flamingo; freeze; gothic; and jungle, to colormaps with high perceptual ranges like apple; chroma; torch; neon; and rainforest. The diverging colormaps in CMasher have a similar variety, but more importantly, several of them have a black center instead of a white center, like iceburn; redshift; watermelon; and wildfire. Black centered diverging colormaps are quite rare as most researchers are used to white centered ones, even though a black centered diverging colormap can be rather useful in certain cases, like plotting a radial velocity map (the further away from the common center, the higher the velocity in either direction, and thus the corresponding color should be brighter).

Installation & Use

How to install

CMasher can be easily installed directly from

_ with::
$ pip install cmasher

or from

_ with::
$ conda install -c conda-forge cmasher  # If conda-forge is not set up as a channel
$ conda install cmasher                 # If conda-forge is set up as a channel

If required, one can also clone the

_ and install CMasher manually::
$ git clone
$ cd CMasher
$ pip install .

CMasher can now be imported as a package with

import cmasher as cmr

Besides Python, CMasher's colormaps can also be accessed in various other languages and applications. A list of all currently known languages and applications that support CMasher can be found in the online documentation


.. _repository: .. _PyPI: .. _conda-forge:

Example use

The colormaps shown above can be accessed by simply importing CMasher. This makes them available in the

module, in addition to registering them in matplotlib's
module (with added
prefix to avoid name clashes). So, for example, if one were to use the rainforest colormap, this could be done with:

.. code:: python

# Import CMasher to register colormaps
import cmasher as cmr

Import packages for plotting

import matplotlib.pyplot as plt import numpy as np

Access rainforest colormap through CMasher or MPL

cmap = cmr.rainforest # CMasher cmap = plt.get_cmap('cmr.rainforest') # MPL

Generate some data to plot

x = np.random.rand(100) y = np.random.rand(100) z = x2+y2

Make scatter plot of data with colormap

plt.scatter(x, y, c=z, cmap=cmap, s=300)

For other use-cases, including an overview of CMasher's utility functions and how to use CMasher in other programming languages and applications, see the

online documentation

.. |PyPI| image:: :target: :alt: PyPI - Latest Release .. |Python| image:: :target: :alt: PyPI - Python Versions .. |GitHub| image:: :target: :alt: GitHub Actions - Build Status .. |ReadTheDocs| image:: :target: :alt: ReadTheDocs - Build Status .. |Coverage| image:: :target: :alt: CodeCov - Coverage Status .. |JOSS| image:: :target: :alt: JOSS - Submission Status .. |conda-forge| image:: :target: :alt: Conda-Forge - Latest Release

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.