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
python3 -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 versionning
cmyt uses semantic versioning as defined by https://semver.org.
In practice this means that new colormaps may be added in minor patches, and any backward incompatible change to existing colormaps will happen as a major change.
If you're developing a library that depends on cmyt, we recommend to set an explicit upper limit as well as a minimal one in your requirements as for instance
cmyt >= 1.0.3, < 2.0.0
with the minimal required version pointing to the e.g. the last colormap addition your need, and the upper limit preventing your CI to upgrade to a major change without your knowing. Also note that only the top level of the package is considered public API.
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
Built Distribution
File details
Details for the file cmyt-1.0.3.tar.gz
.
File metadata
- Download URL: cmyt-1.0.3.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69a3a54ddca6c746f4ebb8dc1fe2078b0d968a3c737dd0377a55ad2100637411 |
|
MD5 | f9dfdfefc781bf81aa484f6d49bf8da4 |
|
BLAKE2b-256 | 9ce231c48b37321289faab60a2847fc9eee27b054503e2c123dc99a70caff8a4 |
File details
Details for the file cmyt-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: cmyt-1.0.3-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dd43a9d9cb92382b39c0f2e40bd3cce8a30f09bbdc97b50f535f71fd1569b86 |
|
MD5 | c159004cf98f9298130dd43c70b5361b |
|
BLAKE2b-256 | e832d5fb8dd7c08f4e4898f91fbbe2b28f61669ce2925a8da074cd9a72950a30 |