cmasher


Namecmasher JSON
Version 1.8.0 PyPI version JSON
download
home_page
SummaryScientific colormaps for making accessible, informative and 'cmashing' plots
upload_time2024-02-19 07:25:41
maintainer
docs_urlNone
author
requires_python<4,>=3.9
licenseBSD-3
keywords cmasher perceptually uniform sequential colormaps plotting python visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |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 `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/cmasher/colormaps/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 <https://cmasher.readthedocs.io/user/usage.html#accessing-colormaps>`_.

.. _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
.. |Coverage| image:: https://img.shields.io/codecov/c/github/1313e/CMasher/master.svg?logo=codecov&logoColor=white&label=Coverage
    :target: https://codecov.io/gh/1313e/CMasher/branches/master
    :alt: CodeCov - Coverage 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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cmasher",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": "",
    "keywords": "cmasher perceptually uniform sequential colormaps plotting python visualization",
    "author": "",
    "author_email": "Ellert van der Velden <ellert_vandervelden@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/90/d78427b14ef5a39b9c3bf41042deb45a910bb421a5cb9dbd7be5ec03ce64/cmasher-1.8.0.tar.gz",
    "platform": "Windows",
    "description": "|PyPI| |conda-forge| |Python| |GitHub| |Coverage| |JOSS|\n\n*CMasher*: Scientific colormaps for making accessible, informative and *cmashing* plots\n=======================================================================================\nThe *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).\nThe 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.\nIt 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*.\nIf 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!\nLet's get rid of all bad colormaps in the world together!\n\n*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.*\n*Additionally, if you use CMasher as part of your workflow in a scientific publication, please consider citing the CMasher paper* (*BibTeX:* ``cmr.get_bibtex``).\n\n.. _issue: https://github.com/1313e/CMasher/issues\n.. _online documentation: https://cmasher.readthedocs.io\n.. _matplotlib: https://github.com/matplotlib/matplotlib\n.. _viscm: https://github.com/matplotlib/viscm\n\nColormap overview\n-----------------\nBelow is an overview of all the colormaps that are currently in *CMasher* (made with the ``cmr.create_cmap_overview()`` function).\nFor more information, see the `online documentation`_.\n\n.. image:: https://github.com/1313e/CMasher/raw/master/cmasher/colormaps/cmap_overview.png\n    :width: 100%\n    :align: center\n    :target: https://cmasher.readthedocs.io\n    :alt: CMasher Colormap Overview\n\nIn 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.\nBecause 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*.\nThe 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*.\nBlack 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).\n\n\nInstallation & Use\n==================\nHow to install\n--------------\n*CMasher* can be easily installed directly from `PyPI`_ with::\n\n    $ pip install cmasher\n\nor from `conda-forge`_ with::\n\n    $ conda install -c conda-forge cmasher  # If conda-forge is not set up as a channel\n    $ conda install cmasher                 # If conda-forge is set up as a channel\n\nIf required, one can also clone the `repository`_ and install *CMasher* manually::\n\n    $ git clone https://github.com/1313e/CMasher\n    $ cd CMasher\n    $ pip install .\n\n*CMasher* can now be imported as a package with ``import cmasher as cmr``.\n\nBesides Python, *CMasher*'s colormaps can also be accessed in various other languages and applications.\nA list of all currently known languages and applications that support *CMasher* can be found in the online documentation `here <https://cmasher.readthedocs.io/user/usage.html#accessing-colormaps>`_.\n\n.. _repository: https://github.com/1313e/CMasher\n.. _PyPI: https://pypi.org/project/CMasher\n.. _conda-forge: https://anaconda.org/conda-forge/CMasher\n\nExample use\n-----------\nThe colormaps shown above can be accessed by simply importing *CMasher*.\nThis 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).\nSo, for example, if one were to use the *rainforest* colormap, this could be done with:\n\n.. code:: python\n\n    # Import CMasher to register colormaps\n    import cmasher as cmr\n\n    # Import packages for plotting\n    import matplotlib as mpl\n    import matplotlib.pyplot as plt\n    import numpy as np\n\n    # Access rainforest colormap through CMasher or MPL\n    cmap = cmr.rainforest                   # CMasher\n    cmap = mpl.colormaps['cmr.rainforest']  # MPL\n\n    # Generate some data to plot\n    x = np.random.rand(100)\n    y = np.random.rand(100)\n    z = x**2+y**2\n\n    # Make scatter plot of data with colormap\n    plt.scatter(x, y, c=z, cmap=cmap, s=300)\n    plt.show()\n\nFor 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`_.\n\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/CMasher.svg?logo=pypi&logoColor=white&label=PyPI\n    :target: https://pypi.python.org/pypi/CMasher\n    :alt: PyPI - Latest Release\n.. |Python| image:: https://img.shields.io/pypi/pyversions/CMasher?logo=python&logoColor=white&label=Python\n    :target: https://pypi.python.org/pypi/CMasher\n    :alt: PyPI - Python Versions\n.. |GitHub| image:: https://img.shields.io/github/actions/workflow/status/1313e/CMasher/.github/workflows/test.yml?branch=dev\n    :target: https://github.com/1313e/CMasher/actions\n    :alt: GitHub Actions - Build Status\n\n.. |ReadTheDocs| image:: https://img.shields.io/readthedocs/cmasher/latest.svg?logo=read%20the%20docs&logoColor=white&label=Docs\n    :target: https://cmasher.readthedocs.io\n    :alt: ReadTheDocs - Build Status\n.. |Coverage| image:: https://img.shields.io/codecov/c/github/1313e/CMasher/master.svg?logo=codecov&logoColor=white&label=Coverage\n    :target: https://codecov.io/gh/1313e/CMasher/branches/master\n    :alt: CodeCov - Coverage Status\n.. |JOSS| image:: https://img.shields.io/badge/JOSS-paper-brightgreen\n   :target: https://doi.org/10.21105/joss.02004\n   :alt: JOSS - Submission Status\n.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/cmasher.svg?logo=conda-forge&logoColor=white\n    :target: https://anaconda.org/conda-forge/cmasher\n    :alt: Conda-Forge - Latest Release\n",
    "bugtrack_url": null,
    "license": "BSD-3",
    "summary": "Scientific colormaps for making accessible, informative and 'cmashing' plots",
    "version": "1.8.0",
    "project_urls": {
        "Documentation": "https://cmasher.readthedocs.io",
        "Homepage": "https://cmasher.readthedocs.io",
        "Source Code": "https://github.com/1313e/CMasher"
    },
    "split_keywords": [
        "cmasher",
        "perceptually",
        "uniform",
        "sequential",
        "colormaps",
        "plotting",
        "python",
        "visualization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a44857fa8e65fd8c9220c055e9cf489da7a9f041f69f26bf90c40636677423a",
                "md5": "bcf26f771f911d8a3fc886def96c5e69",
                "sha256": "f23eea4bf9edc0c1de4f4b806796d374cdc75d8647864328f219a14b6a483846"
            },
            "downloads": -1,
            "filename": "cmasher-1.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bcf26f771f911d8a3fc886def96c5e69",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 533349,
            "upload_time": "2024-02-19T07:25:38",
            "upload_time_iso_8601": "2024-02-19T07:25:38.850230Z",
            "url": "https://files.pythonhosted.org/packages/3a/44/857fa8e65fd8c9220c055e9cf489da7a9f041f69f26bf90c40636677423a/cmasher-1.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d990d78427b14ef5a39b9c3bf41042deb45a910bb421a5cb9dbd7be5ec03ce64",
                "md5": "d00f0cbde7a6d926ac404bc6a672e629",
                "sha256": "b33f2dca9002ca3c87275e3081a7cb6287af963a3e76c862d34e5488b63789d0"
            },
            "downloads": -1,
            "filename": "cmasher-1.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d00f0cbde7a6d926ac404bc6a672e629",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 525457,
            "upload_time": "2024-02-19T07:25:41",
            "upload_time_iso_8601": "2024-02-19T07:25:41.412394Z",
            "url": "https://files.pythonhosted.org/packages/d9/90/d78427b14ef5a39b9c3bf41042deb45a910bb421a5cb9dbd7be5ec03ce64/cmasher-1.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 07:25:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "1313e",
    "github_project": "CMasher",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cmasher"
}
        
Elapsed time: 0.19541s