CMasher

CMasher: Scientific colormaps for making accessible, informative and 'cmashing' plots - Published in JOSS (2020)

https://github.com/1313e/cmasher

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

colormaps data-visualization matplotlib plotting python utility-functions

Keywords from Contributors

cryptocurrencies mesh closember community-driven icesat-2 dynamics astrophysics astronomy exoplanet energy-system
Last synced: 4 months ago · JSON representation ·

Repository

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

Basic Info
Statistics
  • Stars: 459
  • Watchers: 2
  • Forks: 32
  • Open Issues: 9
  • Releases: 12
Topics
colormaps data-visualization matplotlib plotting python utility-functions
Created about 6 years ago · Last pushed 4 months ago
Metadata Files
Readme License Code of conduct Citation

README.rst

|PyPI| |conda-forge| |Python| |GitHub| |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 `matplotlib`_, 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 `viscm`_ 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 `issue`_, 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:* ``cmr.get_bibtex``).

.. _issue: https://github.com/1313e/CMasher/issues
.. _online documentation: https://cmasher.readthedocs.io
.. _matplotlib: https://github.com/matplotlib/matplotlib
.. _viscm: https://github.com/matplotlib/viscm

Colormap overview
-----------------
Below is an overview of all the colormaps that are currently in *CMasher* (made with the ``cmr.create_cmap_overview()`` function).
For more information, see the `online documentation`_.

.. image:: https://github.com/1313e/CMasher/raw/master/static/cmap_overview.png
    :width: 100%
    :align: center
    :target: https://cmasher.readthedocs.io
    :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 `PyPI`_ with::

    $ pip install cmasher

or from `conda-forge`_ 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 `repository`_ and install *CMasher* manually::

    $ git clone https://github.com/1313e/CMasher
    $ 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 `here `_.

.. _repository: https://github.com/1313e/CMasher
.. _PyPI: https://pypi.org/project/CMasher
.. _conda-forge: https://anaconda.org/conda-forge/CMasher

Example use
-----------
The colormaps shown above can be accessed by simply importing *CMasher*.
This makes them available in the ``cmasher`` module, in addition to registering them in *matplotlib*'s ``cm`` module (with added ``'cmr.'`` 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 as mpl
    import matplotlib.pyplot as plt
    import numpy as np

    # Access rainforest colormap through CMasher or MPL
    cmap = cmr.rainforest                   # CMasher
    cmap = mpl.colormaps['cmr.rainforest']  # MPL

    # Generate some data to plot
    x = np.random.rand(100)
    y = np.random.rand(100)
    z = x**2+y**2

    # Make scatter plot of data with colormap
    plt.scatter(x, y, c=z, cmap=cmap, s=300)
    plt.show()

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:: https://img.shields.io/pypi/v/CMasher.svg?logo=pypi&logoColor=white&label=PyPI
    :target: https://pypi.python.org/pypi/CMasher
    :alt: PyPI - Latest Release
.. |Python| image:: https://img.shields.io/pypi/pyversions/CMasher?logo=python&logoColor=white&label=Python
    :target: https://pypi.python.org/pypi/CMasher
    :alt: PyPI - Python Versions
.. |GitHub| image:: https://img.shields.io/github/actions/workflow/status/1313e/CMasher/.github/workflows/test.yml?branch=dev
    :target: https://github.com/1313e/CMasher/actions
    :alt: GitHub Actions - Build Status

.. |ReadTheDocs| image:: https://img.shields.io/readthedocs/cmasher/latest.svg?logo=read%20the%20docs&logoColor=white&label=Docs
    :target: https://cmasher.readthedocs.io
    :alt: ReadTheDocs - Build Status
.. |JOSS| image:: https://img.shields.io/badge/JOSS-paper-brightgreen
   :target: https://doi.org/10.21105/joss.02004
   :alt: JOSS - Submission Status
.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/cmasher.svg?logo=conda-forge&logoColor=white
    :target: https://anaconda.org/conda-forge/cmasher
    :alt: Conda-Forge - Latest Release

Owner

  • Name: Ellert van der Velden
  • Login: 1313e
  • Kind: user
  • Location: Houten
  • Company: Energyworx

Software engineer. Open-source contributor and colormap designer. | "Programming is the art of reducing a big problem to a list of manageable steps." ― 1313e

JOSS Publication

CMasher: Scientific colormaps for making accessible, informative and 'cmashing' plots
Published
February 07, 2020
Volume 5, Issue 46, Page 2004
Authors
Ellert van der Velden ORCID
Centre for Astrophysics and Supercomputing, Swinburne University of Technology, PO Box 218, Hawthorn, VIC 3122, Australia, ARC Centre of Excellence for All Sky Astrophysics in 3 Dimensions (ASTRO 3D)
Editor
Monica Bobra ORCID
Tags
colormaps data visualization plotting science

Citation (CITATION)

@ARTICLE{2020JOSS....5.2004V,
       author = {{van der Velden}, Ellert},
        title = "{CMasher: Scientific colormaps for making accessible, informative and 'cmashing' plots}",
      journal = {The Journal of Open Source Software},
     keywords = {Python, science, colormaps, data visualization, plotting,
         Electrical Engineering and Systems Science - Image and Video Processing,
         Physics - Data Analysis, Statistics and Probability},
         year = 2020,
        month = feb,
       volume = {5},
       number = {46},
          eid = {2004},
        pages = {2004},
          doi = {10.21105/joss.02004},
archivePrefix = {arXiv},
       eprint = {2003.01069},
 primaryClass = {eess.IV},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2020JOSS....5.2004V},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

GitHub Events

Total
  • Create event: 13
  • Issues event: 5
  • Release event: 3
  • Watch event: 28
  • Delete event: 9
  • Issue comment event: 33
  • Push event: 72
  • Pull request review comment event: 1
  • Pull request review event: 3
  • Pull request event: 148
  • Fork event: 3
Last Year
  • Create event: 13
  • Issues event: 5
  • Release event: 3
  • Watch event: 28
  • Delete event: 9
  • Issue comment event: 33
  • Push event: 72
  • Pull request review comment event: 1
  • Pull request review event: 3
  • Pull request event: 148
  • Fork event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 416
  • Total Committers: 10
  • Avg Commits per committer: 41.6
  • Development Distribution Score (DDS): 0.49
Past Year
  • Commits: 97
  • Committers: 4
  • Avg Commits per committer: 24.25
  • Development Distribution Score (DDS): 0.144
Top Committers
Name Email Commits
1313e e****n@o****m 212
Clément Robert c****2@p****m 171
pre-commit-ci[bot] 6****] 10
dependabot[bot] 4****] 8
abatten a****n@g****m 6
Christian Clauss c****s@m****m 4
beskep b****p@n****m 2
Kristen Thyng k****g@g****m 1
Haoyu (Daniel) y****7@o****m 1
Emmanuel Ferdman e****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 34
  • Total pull requests: 270
  • Average time to close issues: 3 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 23
  • Total pull request authors: 13
  • Average comments per issue: 5.44
  • Average comments per pull request: 0.61
  • Merged pull requests: 241
  • Bot issues: 0
  • Bot pull requests: 30
Past Year
  • Issues: 4
  • Pull requests: 157
  • Average time to close issues: 6 days
  • Average time to close pull requests: 1 day
  • Issue authors: 3
  • Pull request authors: 5
  • Average comments per issue: 2.75
  • Average comments per pull request: 0.23
  • Merged pull requests: 136
  • Bot issues: 0
  • Bot pull requests: 24
Top Authors
Issue Authors
  • 1313e (6)
  • neutrinoceros (4)
  • nikosarcevic (2)
  • rdzudzar (2)
  • endolith (2)
  • teuben (1)
  • chadagreene (1)
  • kgrasha (1)
  • meatball880207 (1)
  • adrn (1)
  • psharda (1)
  • DanielYang59 (1)
  • Nordicus (1)
  • horsto (1)
  • sinclair-m (1)
Pull Request Authors
  • neutrinoceros (215)
  • dependabot[bot] (16)
  • 1313e (16)
  • pre-commit-ci[bot] (14)
  • cclauss (3)
  • DanielYang59 (2)
  • aloofgeoduckk (2)
  • emmanuel-ferdman (2)
  • kianmeng (1)
  • kthyng (1)
  • abatten (1)
  • beskep (1)
  • chadagreene (1)
Top Labels
Issue Labels
colormap request (10) feature request (7) awaiting response (4) documentation (3) help wanted (3) more info (2) enquiry (2) bug (1)
Pull Request Labels
dependencies (41) github_actions (16) bug (5) documentation (3)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 36,770 last-month
  • Total docker downloads: 9
  • Total dependent packages: 17
  • Total dependent repositories: 39
  • Total versions: 48
  • Total maintainers: 2
pypi.org: cmasher

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

  • Versions: 48
  • Dependent Packages: 17
  • Dependent Repositories: 39
  • Downloads: 36,770 Last month
  • Docker Downloads: 9
Rankings
Dependent packages count: 0.8%
Dependent repos count: 2.3%
Downloads: 2.5%
Stargazers count: 3.4%
Average: 3.4%
Docker downloads count: 3.8%
Forks count: 7.4%
Maintainers (2)
Last synced: 4 months ago

Dependencies

pyproject.toml pypi
  • colorspacious >=1.1.0
  • matplotlib >=3.5
  • numpy >=1.19.3
requirements/dependencies.txt pypi
  • colorspacious >=1.1.0
  • matplotlib >=3.5
  • numpy >=1.19.3
requirements/dev.txt pypi
  • pyqt5 >=5.12 development
  • pytest >=4.6.0 development
  • pytest-cov * development
  • pytest-mpl * development
  • readme_renderer * development
  • scipy >=1.0.0 development
  • setuptools >=38.6.0 development
  • viscm >=0.10 development
  • wheel >=0.31.0 development
requirements/docs.txt pypi
  • jinja2 ==3.1.2
  • markupsafe ==2.1.3
  • sphinx ==7.2.6
  • sphinx-autobuild ==2021.3.14
  • sphinx_rtd_theme ==2.0.0
requirements/typecheck.txt pypi
  • mypy ==1.7.1
  • pytest ==7.4.3
  • typing-extensions ==4.9.0
.github/workflows/lint_python.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite