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-2.0.0.tar.gz
(30.5 kB
view details)
Built Distribution
cmyt-2.0.0-py3-none-any.whl
(31.8 kB
view details)
File details
Details for the file cmyt-2.0.0.tar.gz
.
File metadata
- Download URL: cmyt-2.0.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4beef670f488818efc6ac30491bae81b63a71590936e8cdd3dc3fc9027ab4bfd |
|
MD5 | ab2e27801bdfe8eb77f4105c8aff32df |
|
BLAKE2b-256 | 0b29d2b60efe3b1695b95199ce421741a4f464c8256a26ba12d0ae3a4d8bf123 |
Provenance
File details
Details for the file cmyt-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: cmyt-2.0.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b40f396d9b9545be93c2c82d35efcc1260e041db831fa5b009b972153267796 |
|
MD5 | 078dca22ec3b37baa321c5068684659f |
|
BLAKE2b-256 | ab22638eb42617ae88da3654f61273e385bb0215eb85216faec62e716dcf014c |