class_docstr: Mixin to provide labelling capability to `.ContourSet`.
class_docstr_tok: ["Mixin","to","provide","labelling","capability","to","`",".ContourSet","`","."]
docstr: Add a contour label, respecting whether *use_clabeltext* was set.
docstr_tok: ["Add","a","contour","label",",","respecting","whether","*","use_clabeltext","*","was","set","."]
code: def add_label(self, x, y, rotation, lev, cvalue):
      """Add a contour label, respecting whether *use_clabeltext* was set."""
      data_x, data_y = self.axes.transData.inverted().transform((x, y))
      t = Text(
          data_x,
          data_y,
          text=self.get_text(lev, self.labelFmt),
          rotation=rotation,
          horizontalalignment="center",
          verticalalignment="center",
          zorder=self._clabel_zorder,
          color=self.labelMappable.to_rgba(
              cvalue, alpha=self.get_alpha()
          ),
          fontproperties=self._label_font_props,
          clip_box=self.axes.bbox,
      )
      if self._use_clabeltext:
          (
              data_rotation,
          ) = self.axes.transData.inverted().transform_angles(
              [rotation], [[x, y]]
          )
          t.set(rotation=data_rotation, transform_rotates_text=True)
      self.labelTexts.append(t)
      self.labelCValues.append(cvalue)
      self.labelXYs.append((x, y))
      # Add label to plot here - useful for manual mode label selection
      self.axes.add_artist(t)
  
imports: from contextlib import ExitStack
  import functools
  import math
  from numbers import Integral
  import numpy
  from numpy import ma
  import matplotlib
  from matplotlib import _api, _docstring
  from matplotlib.backend_bases import MouseButton
  from matplotlib.lines import Line2D
  from matplotlib.path import Path
  from matplotlib.text import Text
  import matplotlib.ticker
  import matplotlib.cm
  import matplotlib.colors
  import matplotlib.collections
  import matplotlib.font_manager
  import matplotlib.cbook
  import matplotlib.patches
  import matplotlib.transforms
label_desc: Use image node_id 9 for calling the ContourLabeler obj's underlying member method code with example usage: obj.add_label(x, y, rotation, lev, cvalue) without return types