class_docstr: Mixin to provide labelling capability to `.ContourSet`.
class_docstr_tok: ["Mixin","to","provide","labelling","capability","to","`",".ContourSet","`","."]
docstr: Return the width of the *nth* label, in pixels.
docstr_tok: ["Return","the","width","of","the","*","nth","*","label",",","in","pixels","."]
code: def _get_nth_label_width(self, nth):
      """Return the width of the *nth* label, in pixels."""
      fig = self.axes.figure
      renderer = fig._get_renderer()
      return (
          Text(
              0,
              0,
              self.get_text(self.labelLevelList[nth], self.labelFmt),
              figure=fig,
              fontproperties=self._label_font_props,
          )
          .get_window_extent(renderer)
          .width
      )
  
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 4 for calling the ContourLabeler obj's underlying member method code with example usage: obj._get_nth_label_width(nth) and returns: Text