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

Uploaded Source

Built Distribution

cmyt-1.2.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmyt-1.2.0.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for cmyt-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3cd6a6dbdbf29308bc432604ae9a55e874c8502fc218057195c354a74c82a07b
MD5 74da58dc2b0dc053ac7d06a265695102
BLAKE2b-256 1dc8cf6f8bcef86ed426ca6de0f6d778a548ccd382374dd791b2658241fb551f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmyt-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for cmyt-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cbca1f89a870402c66ecc50db1e0fde41f33e76d526d594cb7bcbaf4e3d817c
MD5 c8588df7b964a1d8e7c53485d14ad50a
BLAKE2b-256 71aa366157c4f46ec358ea4142a10a549b0cbed464b68b9dc4fc6cc7e90e0de6

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