class_docstr: Mapping that sets artist colors according to data values.
class_docstr_tok: ["Mapping","that","sets","artist","colors","according","to","data","values","."]
docstr: Determine colors when the hue variable is quantitative.
docstr_tok: ["Determine","colors","when","the","hue","variable","is","quantitative","."]
code: def numeric_mapping(self, data, palette, norm):
      """Determine colors when the hue variable is quantitative."""
      if isinstance(palette, dict):
          # The presence of a norm object overrides a dictionary of hues
          # in specifying a numeric mapping, so we need to process it here.
          levels = list(sorted(palette))
          colors = [palette[k] for k in sorted(palette)]
          cmap = mpl.colors.ListedColormap(colors)
          lookup_table = palette.copy()
  
      else:
          # The levels are the sorted unique values in the data
          levels = list(np.sort(remove_na(data.unique())))
  
          # --- Sort out the colormap to use from the palette argument
  
          # Default numeric palette is our default cubehelix palette
          # TODO do we want to do something complicated to ensure contrast?
          palette = "ch:" if palette is None else palette
  
          if isinstance(palette, mpl.colors.Colormap):
              cmap = palette
          else:
              cmap = color_palette(palette, as_cmap=True)
  
          # Now sort out the data normalization
          if norm is None:
              norm = mpl.colors.Normalize()
          elif isinstance(norm, tuple):
              norm = mpl.colors.Normalize(*norm)
          elif not isinstance(norm, mpl.colors.Normalize):
              err = "``hue_norm`` must be None, tuple, or Normalize object."
              raise ValueError(err)
  
          if not norm.scaled():
              norm(np.asarray(data.dropna()))
  
          lookup_table = dict(zip(levels, cmap(norm(levels))))
  
      return levels, lookup_table, norm, cmap
  
imports: from __future__ import annotations
  import warnings
  import itertools
  from copy import copy
  from collections import UserString
  from collections.abc import Iterable, Sequence, Mapping
  from numbers import Number
  from datetime import datetime
  import numpy
  import pandas
  import matplotlib
  from seaborn._core.data import PlotData
  from seaborn.palettes import QUAL_PALETTES, color_palette
  from seaborn.utils import _check_argument, _version_predates, desaturate, locator_to_legend_entries, get_color_cycle, remove_na
label_desc: Use image node_id 5 for calling the HueMapping obj's underlying member method code with example usage: obj.numeric_mapping(data, palette, norm) and returns: levels,  lookup_table,  norm,  cmap