simonsobs / pixell

A rectangular pixel map manipulation and harmonic analysis library derived from Sigurd Naess' enlib.
Other
42 stars 32 forks source link

Fix colormap registration #269

Open xgarrido opened 1 month ago

xgarrido commented 1 month ago

matplotlib.cm.register_cmap has been removed and matplotlib.colormaps.register has been around since almost 3 years (since version 3.5.0 of matplotlib). Not sure it is worth adding a backward compatible flag such as

import matplotlib
if matplotlib.__version__ >= "3.5.0":
  matplotlib.colormaps.register(cmap, name=name)
else:
  matplotlib.cm.register_cmap(name, cmap)