Skip to main content

A collection of Matplotlib colormaps from the yt project

Project description

cmyt

PyPI Supported Python Versions

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

yt-project Code style: black

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

python3 -m pip install 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. Likewise, adding support for new Python/Matplotlib versions will be considered minor changes, while droping support for EOL Python/Matplotlib version will be considered major. 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.1, < 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


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.0.1.post1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

cmyt-1.0.1.post1-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file cmyt-1.0.1.post1.tar.gz.

File metadata

  • Download URL: cmyt-1.0.1.post1.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cmyt-1.0.1.post1.tar.gz
Algorithm Hash digest
SHA256 e17d6cceb7c032c79ee8e07be8b7a93920fd70f4c780057dfc84676e80eb2073
MD5 c66a05346672f9aa25b5983e5af3a273
BLAKE2b-256 95f54d4a2f6d7b650c878371774b9b6a404ac6cce6f6624aa55feb2de209b543

See more details on using hashes here.

File details

Details for the file cmyt-1.0.1.post1-py3-none-any.whl.

File metadata

  • Download URL: cmyt-1.0.1.post1-py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cmyt-1.0.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5cdfc57c425f7029db19d74bf492f871d866ce65d10ac1e9b2273adccb4b0f
MD5 4faa950f6e162c5777810308e4db0681
BLAKE2b-256 bde0a473e18d01f71d64bcb5c7aed29a4c128d29487ec15ccdd1f393500cc12f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page