uvex_transients.utils.plotting.get_cmap#

uvex_transients.utils.plotting.get_cmap(cmap: str | Colormap) → Colormap[source]#

Resolve a colormap name (or an already-resolved colormap) to a ~matplotlib.colors.Colormap.

Parameters:

cmap (str or matplotlib.colors.Colormap) – Either the name of a registered Matplotlib colormap, or a Colormap instance (returned unchanged).

Returns:

The resolved colormap.

Return type:

matplotlib.colors.Colormap

Raises:
  • TypeError – If cmap is neither a str nor a Colormap.

  • ValueError – If cmap is a str but names no registered colormap.