Skip to main content

A collection of Matplotlib colormaps from the yt project

Project description

cmyt

PyPI Conda Version

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

yt-project 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-2.0.1.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

cmyt-2.0.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmyt-2.0.1.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cmyt-2.0.1.tar.gz
Algorithm Hash digest
SHA256 a24c5cf765458fa8ed6b70c37d9531cdd8ae79ae96f916d26a3c3c169b18346e
MD5 3a0c9a203a02f36ec1c11cc43b7dee8d
BLAKE2b-256 2bb33b914f2d904938630ceac2e069212fd83be977be92449449e7787d7b3e3c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmyt-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cmyt-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c866420afb97dae85aad9b73f0a6a5f568ca08fafbef3c2870c949a38c252ec
MD5 a27f410511ae1d7b9da4fcf165251cfa
BLAKE2b-256 e6b333d28d51b70ed95b2c47a4b2e6550b212fb7c037aac1fa08324b77880237

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