Skip to main content

A collection of Matplotlib colormaps from the yt project

Project description

cmyt

PyPI Conda Version Supported Python Versions

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.

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.3.1.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmyt-1.3.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file cmyt-1.3.1.tar.gz.

File metadata

  • Download URL: cmyt-1.3.1.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cmyt-1.3.1.tar.gz
Algorithm Hash digest
SHA256 4e0bcf113b87019537f4d50601da8810d3b9f5ae7a13ace4848b1d3010ca06a8
MD5 bd9fbd0d6516bebec6632c8bd6abb796
BLAKE2b-256 0c3b00563af49f09d4a400483bdeaa040b2ba9120b629d44ffbc4e902f431a2a

See more details on using hashes here.

File details

Details for the file cmyt-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: cmyt-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cmyt-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5eede85d3186da1ab029b808ac9fd4faf79766a7e926bae43c2f99db2da5532c
MD5 8f99fd348d18d7f119499c57d1110f9c
BLAKE2b-256 2c12f85b189cc0768dba10c42ebf051424c9979d7f9059f153221c16e72e963f

See more details on using hashes here.

Supported by

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