Skip to content

mimi1vx/cmyt

This branch is 145 commits behind yt-project/cmyt:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 3, 2023
Sep 17, 2023
Apr 16, 2023
Sep 15, 2023
Feb 21, 2023
Apr 16, 2023
Jul 15, 2021
Oct 2, 2023
Jul 15, 2021
Jul 15, 2021
Sep 7, 2023
Oct 3, 2023

Repository files navigation

cmyt

PyPI Conda Version

CI CI (bleeding edge) pre-commit.ci status

yt-project Code style: black Ruff

Matplotlib colormaps from the yt project !

Colormaps overview

The following colormaps, as well as their respective reversed (*_r) versions are available

Perceptually uniform sequential colormaps

Monochromatic sequential colormaps

Miscellaneous

Installation

with pip

python -m pip install cmyt

or with conda

conda install -c conda-forge cmyt

Usage

cmyt integrates with matplotlib in a similar fashion to cmocean or cmasher

import numpy as np
import matplotlib.pyplot as plt
import cmyt  # that's it !

# generate example data
prng = np.random.RandomState(0x4D3D3D3)
noise = prng.random_sample((100, 100))
x, y = np.mgrid[-50:50, -50:50]
z = 5 * np.exp(-(x**2 + y**2) / 1000)

# setup the figure
fig, ax = plt.subplots()
ax.set(aspect="equal")

# now we can refer to cmyt colormaps as strings
im = ax.pcolormesh(x, y, z + noise, cmap="cmyt.arbre", shading="flat")
fig.colorbar(im, ax=ax)

# alternatively, cmyt maps can also be imported as objects
from cmyt import pastel

fig, ax = plt.subplots()
ax.set(aspect="equal")
im = ax.contourf(x, y, z + noise, cmap=pastel)
fig.colorbar(im, ax=ax)

A gallery of comparable examples using all colormaps from cmyt is available in the test directory.

About

yt-native colormaps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%