class_docstr: A mixin class to map scalar data to RGBA.
  
  The ScalarMappable applies data normalization before returning RGBA colors
  from the given colormap.
docstr: Set the colormap for luminance data.
  
  Parameters
  ----------
  cmap : `.Colormap` or str or None
docstr_tok: ["Set","the","colormap","for","luminance","data",".","Parameters","--","--","--","--","--","cmap",":","`",".Colormap","`","or","str","or","None"]
code: def set_cmap(self, cmap):
      """
      Set the colormap for luminance data.
  
      Parameters
      ----------
      cmap : `.Colormap` or str or None
      """
      in_init = self.cmap is None
  
      self.cmap = _ensure_cmap(cmap)
      if not in_init:
          self.changed()
  
imports: from collections.abc import Mapping
  import functools
  import numpy
  from numpy import ma
  import matplotlib
  from matplotlib import _api, colors, cbook, scale
  from matplotlib._cm import datad
  from matplotlib._cm_listed import cmaps
label_desc: Use image node_id 10 for calling the ScalarMappable obj's underlying member method code with example usage: obj.set_cmap(cmap) without return types