This is a template package for distributing Matplotlib colormaps as Python packages.
To use it, clone this repository, edit the (intentionally commented-out)
metadata in setup.py
, and edit the colormap data in lib/nifty.py
and
rename it to your own colormap name.
You can then install the package using pip install ...
(or alternatively
just move lib/nifty.py
into your own Python project), then use the colormap
with e.g.
from matplotlib import pyplot as plt
import nifty
fig, ax = plt.subplots()
ax.imshow([[0, 1], [2, 3]], cmap=nifty.cmap)
# or register the colormap to use the name as string
nifty.register_cmap()
fig, ax = plt.subplots()
ax.imshow([[0, 1], [2, 3]], cmap="nifty")
and just visualize the colormap with
$ python -m nifty