A collection of Matplotlib colormaps from the yt project
Project description
cmyt
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cmyt-1.3.0.tar.gz
(30.6 kB
view details)
Built Distribution
cmyt-1.3.0-py3-none-any.whl
(31.9 kB
view details)
File details
Details for the file cmyt-1.3.0.tar.gz
.
File metadata
- Download URL: cmyt-1.3.0.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e974ec192d2be1c25e0635093074d612439e837819d34cc2a2bb3d2cb42734 |
|
MD5 | cd4052de4174d00b0e51b206df089842 |
|
BLAKE2b-256 | ea6aa47e25f2941e28de5e7458807835992c16c0c57938da13fa264bd2f17156 |
File details
Details for the file cmyt-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: cmyt-1.3.0-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8a6808fc9732e7f84df17a01504837cf8650b963a4785855562bdc93bd44f14 |
|
MD5 | 20c41db883446d99209df806856b25c7 |
|
BLAKE2b-256 | 19e0b18310d9a5d303317bfb675176b4114fd4173f0b20baff98b1c0280090bb |