Install & Compatibility
Where this runs
tested against v0.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.192s · 177.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.4s · import 1.182s · 170MB
181MB installed
● package 181MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
cmweather
✓ import cmweather
Import the module to register colormaps with matplotlib; no main class.
cmweather.cm
✓ from cmweather import cm
✗ from cmweather import Colormap
Colormaps are accessed via cm module, not a Colormap class.
Basic usage: import cmweather to register colormaps, then use them as 'cmweather.<name>'.
import matplotlib.pyplot as plt
import numpy as np
import cmweather
# Generate sample data
x = np.linspace(0, 10, 100)
y = np.linspace(0, 10, 100)
X, Y = np.meshgrid(x, y)
Z = np.sin(X) * np.cos(Y)
# Use a CVD-friendly colormap
plt.contourf(X, Y, Z, cmap='cmweather.viridis')
plt.colorbar()
plt.show()
Errors
Common errors & fixes
KeyError: 'viridis'
Colormap not registered because cmweather was not imported, or colormap name is incorrect.
fixAdd 'import cmweather' at the top of your script. Use 'plt.get_cmap("cmweather.viridis")'. ValueError: Colormap 'cmweather.viridis' is not of known type
Matplotlib version too old (<2.0) or cmweather not properly installed.
fixUpgrade matplotlib: 'pip install matplotlib --upgrade'. Reinstall cmweather: 'pip install cmweather --upgrade'.
ImportError: cannot import name 'Colormap' from 'cmweather'
Trying to import a class that doesn't exist.
fixUse 'from cmweather import cm' instead.
Upgrade
Version history
0.3.2latest on PyPI · released Jan 4, 2024
Audit
Dependencies
matplotlibrequiredAll colormaps are matplotlib-compatible
numpyoptionalUsed internally for color data manipulation