text: matplotlib.cm#.ColormapRegistry(cmaps)[source]#
  Bases:
  collections.abc.Mapping)
  - register(cmap, *, name=None, force=False)[source]#
  Register a new colormap.
  The colormap name can then be used as a string argument to any
  cmapparameter in Matplotlib. It is also available in
  pyplot.get_cmap.
  The colormap registry stores a copy of the given colormap, so that future changes to the original colormap instance do not affect the registered colormap. Think of this as the registry taking a snapshot of the colormap at registration.
  - Parameters
  - cmapmatplotlib.colors.Colormap
  The colormap to register.
  - namestr, optional
  The name for the colormap. If not given,
  cmap.nameis used.
  - force: bool, default: False
  If False, a ValueError is raised if trying to overwrite an already registered name. True supports overwriting registered colormaps other than the builtin colormaps.
  - class matplotlib.cm.ScalarMappable(norm=None, cmap=None)[source]#
  A mixin class to map scalar data to RGBA.
  The ScalarMappable applies data normalization before returning RGBA colors from the given colormap.
  - Parameters
  - norm
  matplotlib.colors.Normalize(or subclass thereof)
  The normalizing object which scales data, typically into the interval
  [0, 1]. If None, norm defaults to a colors.Normalize object which initializes its scaling based on the first data processed.
  - cmapstr or
  Colormap
  The colormap used to map normalized data values to RGBA colors.
  - autoscale_None()[source]#
  Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
  - changed()[source]#
  Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
  - get_array()[source]#
  Return the array of values, that are mapped to colors.
  The base class
  ScalarMappabledoes not make any assumptions on the dimensionality and shape of the array.
  - set_array(A)[source]#
  Set the value array from array-like A.
  - Parameters
  - Aarray-like or None
  The values that are mapped to colors.
  The base class
  ScalarMappabledoes not make any assumptions on the dimensionality and shape of the value array A.
  - set_clim(vmin=None, vmax=None)[source]#
  Set the norm limits for image scaling.
  - Parameters
  - vmin, vmaxfloat
  The limits.
  The limits may also be passed as a tuple (vmin, vmax) as a single positional argument.
  - set_norm(norm)[source]#
  Set the normalization instance.
  Notes
  If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
  - to_rgba(x, alpha=None, bytes=False, norm=True)[source]#
  Return a normalized rgba array corresponding to x.
  In the normal case, x is a 1D or 2D]#
  Get a colormap instance, defaulting to rc values if name is None.
  Colormaps added with
  register_cmap()take precedence over built-in colormaps.
  - Parameters
  - name
  matplotlib.colors.Colormapor str or None, default: None
  If a
  Colormapinstance, it will be returned. Otherwise, the name of a colormap known to Matplotlib, which will be resampled by lut. The default, None, means
  rcParams["image.cmap"](default:
  'viridis').
  - lutint or None, default: None
  If name is not already a Colormap instance and lut is not None, the colormap will be resampled to have lut entries in the lookup table.
  Notes
  Currently, this returns the global colormap object. This is undesired because users could accidentally modify the global colormap. From Matplotlib 3.6 on, this will return a copy instead.
  - matplotlib.cm.register_cmap(name=None, cmap=None, *, override_builtin=False)[source]#
  Add a colormap to the set recognized by
  get_cmap().
  Register a new colormap to be accessed by name
  LinearSegmentedColormap('swirly', data, lut) register_cmap(cmap=swirly_cmap)
  - Parameters
  - namestr, optional
  The name that can be used in
  get_cmap()or
  rcParams["image.cmap"](default:
  'viridis')
  If absent, the name will be the
  nameattribute of the cmap.
  - cmapmatplotlib.colors.Colormap
  Despite being the second argument and having a default value, this is a required argument.
  - override_builtinbool
  Allow built-in colormaps to be overridden by a user-supplied colormap.
  Please do not use this unless you are sure you need it.
  Notes
  Registering a colormap stores a reference to the colormap object which can currently be modified and inadvertently change the global colormap state. This behavior is deprecated and in Matplotlib 3.5 the registered colormap will be immutable.
  - matplotlib.cm.unregister_cmap(name)[source]#
  Remove a colormap recognized by
  get_cmap().
  You may not remove built-in colormaps.
  If the named colormap is not registered, returns with no error, raises if you try to de-register a default colormap.
  Warning
  Colormap names are currently a shared namespace that may be used by multiple packages. Use
  unregister_cmaponly if you know you have registered that name before. In particular, do not unregister just in case to clean the name before registering a new colormap.