All Projects → 1313e → Cmasher

1313e / Cmasher

Licence: bsd-3-clause
Scientific colormaps for making accessible, informative and 'cmashing' plots

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cmasher

Joypy
Joyplots in Python with matplotlib & pandas 📈
Stars: ✭ 322 (+116.11%)
Mutual labels:  data-visualization, matplotlib, plotting
Uplot
📈 A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+4469.13%)
Mutual labels:  data-visualization, plotting
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (+390.6%)
Mutual labels:  matplotlib, plotting
Deep learning projects
Stars: ✭ 28 (-81.21%)
Mutual labels:  data-visualization, matplotlib
Sjplot
sjPlot - Data Visualization for Statistics in Social Science
Stars: ✭ 432 (+189.93%)
Mutual labels:  data-visualization, plotting
Clip
Create charts from the command line
Stars: ✭ 5,111 (+3330.2%)
Mutual labels:  data-visualization, plotting
Mplcyberpunk
"Cyberpunk style" for matplotlib plots
Stars: ✭ 762 (+411.41%)
Mutual labels:  matplotlib, plotting
Pyplot.jl
Plotting for Julia based on matplotlib.pyplot
Stars: ✭ 347 (+132.89%)
Mutual labels:  matplotlib, plotting
Ds and ml projects
Data Science & Machine Learning projects and tutorials in python from beginner to advanced level.
Stars: ✭ 56 (-62.42%)
Mutual labels:  data-visualization, matplotlib
Gr.rb
Ruby wrapper for the GR framework
Stars: ✭ 60 (-59.73%)
Mutual labels:  data-visualization, plotting
Seaborn
Statistical data visualization in Python
Stars: ✭ 9,007 (+5944.97%)
Mutual labels:  data-visualization, matplotlib
Chartpy
Easy to use Python API wrapper to plot charts with matplotlib, plotly, bokeh and more
Stars: ✭ 426 (+185.91%)
Mutual labels:  matplotlib, plotting
Pywaffle
🧇 Make Waffle Charts in Python.
Stars: ✭ 406 (+172.48%)
Mutual labels:  data-visualization, matplotlib
Ggthemr
Themes for ggplot2.
Stars: ✭ 697 (+367.79%)
Mutual labels:  data-visualization, plotting
Animatplot
A python package for animating plots build on matplotlib.
Stars: ✭ 359 (+140.94%)
Mutual labels:  data-visualization, plotting
Scottplot
Interactive Plotting Library for .NET
Stars: ✭ 736 (+393.96%)
Mutual labels:  data-visualization, plotting
Ggplotnim
A port of ggplot2 for Nim
Stars: ✭ 95 (-36.24%)
Mutual labels:  data-visualization, plotting
Corner.py
Make some beautiful corner plots
Stars: ✭ 327 (+119.46%)
Mutual labels:  data-visualization, plotting
Bubbly
A python package for plotting animated and interactive bubble charts using Plotly
Stars: ✭ 37 (-75.17%)
Mutual labels:  data-visualization, plotting
Pandoc Plot
Render and include figures in Pandoc documents using your plotting toolkit of choice
Stars: ✭ 75 (-49.66%)
Mutual labels:  matplotlib, plotting

|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). 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; heat; 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.

.. _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.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 = 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, 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/workflow/status/1313e/CMasher/Test?logo=github&logoColor=white&label=Actions :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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].