You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v3.3.3). For the latest version see <ahref="https://matplotlib.org/stable/api/contour_api.html">https://matplotlib.org/stable/api/contour_api.html</a></div>
<spanid="matplotlib-contour"></span><h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.contour</span></code><aclass="headerlink" href="#module-matplotlib.contour" title="Permalink to this headline">¶</a></h1>
<p>Classes to support contour plotting and labelling for the Axes class.</p>
<trclass="row-even"><td><aclass="reference internal" href="text_api.html#matplotlib.text.Text.set_fontproperties" title="matplotlib.text.Text.set_fontproperties"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">fontproperties</span></code></a> or font or font_properties</td>
<td>{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}</td>
<codeclass="descname">get_rotation</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ClabelText.get_rotation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ClabelText.get_rotation" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the text angle in degrees between 0 and 360.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.contour.ContourLabeler">
<emclass="property">class </em><codeclass="descclassname">matplotlib.contour.</code><codeclass="descname">ContourLabeler</code><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler" title="Permalink to this definition">¶</a></dt>
<p>Mixin to provide labelling capability to <aclass="reference internal" href="#matplotlib.contour.ContourSet" title="matplotlib.contour.ContourSet"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ContourSet</span></code></a>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>x, y</strong><spanclass="classifier">float</span></dt><dd><p>The approximate location of the label.</p>
</dd>
<dt><strong>inline</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>If <em>True</em> remove the segment of the contour beneath the label.</p>
</dd>
<dt><strong>inline_spacing</strong><spanclass="classifier">int, default: 5</span></dt><dd><p>Space in pixels to leave on each side of label when placing
inline. This spacing will be exact for labels at locations where
the contour is straight, less so for labels on curved contours.</p>
<codeclass="descname">calc_label_rot_and_inline</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">slc</span></em>, <em><spanclass="n">ind</span></em>, <em><spanclass="n">lw</span></em>, <em><spanclass="n">lc</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">spacing</span><spanclass="o">=</span><spanclass="default_value">5</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.calc_label_rot_and_inline"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.calc_label_rot_and_inline" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the appropriate label rotation given the linecontour
coordinates in screen units, the index of the label location and the
label width.</p>
<p>If <em>lc</em> is not None or empty, also break contours and compute
inlining.</p>
<p><em>spacing</em> is the empty space to leave around the label, in pixels.</p>
<p>Both tasks are done together to avoid calculating path lengths
multiple times, which is relatively costly.</p>
<p>The method used here involves computing the path length along the
contour in pixel coordinates and then looking approximately (label
width / 2) away from central point to determine rotation and then to
break contour if desired.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.contour.ContourLabeler.clabel">
<codeclass="descname">clabel</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">levels</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="o">*</span></em>, <em><spanclass="n">fontsize</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">inline</span><spanclass="o">=</span><spanclass="default_value">True</span></em>, <em><spanclass="n">inline_spacing</span><spanclass="o">=</span><spanclass="default_value">5</span></em>, <em><spanclass="n">fmt</span><spanclass="o">=</span><spanclass="default_value">'%1.3f'</span></em>, <em><spanclass="n">colors</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">use_clabeltext</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <em><spanclass="n">manual</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <em><spanclass="n">rightside_up</span><spanclass="o">=</span><spanclass="default_value">True</span></em>, <em><spanclass="n">zorder</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.clabel"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.clabel" title="Permalink to this definition">¶</a></dt>
<dd><p>Label a contour plot.</p>
<p>Adds labels to line contours in this <aclass="reference internal" href="#matplotlib.contour.ContourSet" title="matplotlib.contour.ContourSet"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ContourSet</span></code></a> (which inherits from
<dt><strong>levels</strong><spanclass="classifier">array-like, optional</span></dt><dd><p>A list of level values, that should be labeled. The list must be
a subset of <codeclass="docutils literal notranslate"><spanclass="pre">cs.levels</span></code>. If not given, all levels are labeled.</p>
</dd>
<dt><strong>fontsize</strong><spanclass="classifier">str or float, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=font.size#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["font.size"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">10.0</span></code>)</span></dt><dd><p>Size in points or relative size e.g., 'smaller', 'x-large'.
See <aclass="reference internal" href="text_api.html#matplotlib.text.Text.set_size" title="matplotlib.text.Text.set_size"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text.set_size</span></code></a> for accepted string values.</p>
</dd>
<dt><strong>colors</strong><spanclass="classifier">color or colors or None, default: None</span></dt><dd><p>The label colors:</p>
<ulclass="simple">
<li>If <em>None</em>, the color of each label matches the color of
the corresponding contour.</li>
<li>If one string color, e.g., <em>colors</em> = 'r' or <em>colors</em> =
'red', all labels will be plotted in this color.</li>
<li>If a tuple of colors (string, float, rgb, etc), different labels
will be plotted in different colors in the order specified.</li>
</ul>
</dd>
<dt><strong>inline</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>If <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code> the underlying contour is removed where the label is
placed.</p>
</dd>
<dt><strong>inline_spacing</strong><spanclass="classifier">float, default: 5</span></dt><dd><p>Space in pixels to leave on each side of label when placing inline.</p>
<p>This spacing will be exact for labels at locations where the
contour is straight, less so for labels on curved contours.</p>
</dd>
<dt><strong>fmt</strong><spanclass="classifier">str or dict, default: '%1.3f'</span></dt><dd><p>A format string for the label.</p>
<p>Alternatively, this can be a dictionary matching contour levels
with arbitrary strings to use for each contour level (i.e.,
fmt[level]=string), or it can be any callable, such as a
<aclass="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Formatter</span></code></a> instance, that returns a string when called with a
numeric contour level.</p>
</dd>
<dt><strong>manual</strong><spanclass="classifier">bool or iterable, default: False</span></dt><dd><p>If <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>, contour labels will be placed manually using
mouse clicks. Click the first button near a contour to
add a label, click the second button (or potentially both
mouse buttons at once) to finish adding labels. The third
button can be used to remove the last label added, but
only if labels are not inline. Alternatively, the keyboard
can be used to select label locations (enter to end label
placement, delete or backspace act like the third mouse button,
and any other key will select a label location).</p>
<p><em>manual</em> can also be an iterable object of (x, y) tuples.
Contour labels will be created as if mouse is clicked at each
(x, y) position.</p>
</dd>
<dt><strong>rightside_up</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>If <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>, label rotations will always be plus
or minus 90 degrees from level.</p>
</dd>
<dt><strong>use_clabeltext</strong><spanclass="classifier">bool, default: False</span></dt><dd><p>If <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>, <aclass="reference internal" href="#matplotlib.contour.ClabelText" title="matplotlib.contour.ClabelText"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ClabelText</span></code></a> class (instead of <aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text</span></code></a>) is used to
of texts during the drawing time, therefore this can be used if
aspect of the axes changes.</p>
</dd>
<dt><strong>zorder</strong><spanclass="classifier">float or None, default: <codeclass="docutils literal notranslate"><spanclass="pre">(2</span><spanclass="pre">+</span><spanclass="pre">contour.get_zorder())</span></code></span></dt><dd><p>zorder of the contour labels.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt>labels</dt><dd><p>A list of <aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text</span></code></a> instances for the labels.</p>
<codeclass="descname">get_text</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">lev</span></em>, <em><spanclass="n">fmt</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.get_text"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.get_text" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the text of the label.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.contour.ContourLabeler.labels">
<codeclass="descname">labels</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">inline</span></em>, <em><spanclass="n">inline_spacing</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.labels"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.labels" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">locate_label</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">linecontour</span></em>, <em><spanclass="n">labelwidth</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.locate_label"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.locate_label" title="Permalink to this definition">¶</a></dt>
<dd><p>Find good place to draw a label (relatively flat part of the contour).</p>
<codeclass="descname">pop_label</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">index</span><spanclass="o">=</span><spanclass="default_value">- 1</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.pop_label"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.pop_label" title="Permalink to this definition">¶</a></dt>
<dd><p>Defaults to removing last label, but any index can be supplied</p>
<codeclass="descname">print_label</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">linecontour</span></em>, <em><spanclass="n">labelwidth</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourLabeler.print_label"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourLabeler.print_label" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether a contour is long enough to hold a label.</p>
<dt><strong>levels</strong><spanclass="classifier">[level0, level1, ..., leveln]</span></dt><dd><p>A list of floating point numbers indicating the contour levels.</p>
</dd>
<dt><strong>allsegs</strong><spanclass="classifier">[level0segs, level1segs, ...]</span></dt><dd><p>List of all the polygon segments for all the <em>levels</em>.
For contour lines <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">==</span><spanclass="pre">len(levels)</span></code>, and for
filled contour regions <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">=</span><spanclass="pre">len(levels)-1</span></code>. The lists
<dt><strong>allkinds</strong><spanclass="classifier"><codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> or [level0kinds, level1kinds, ...]</span></dt><dd><p>Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">len(allkinds)</span><spanclass="pre">==</span><spanclass="pre">len(allsegs)</span></code>. The lists
<dt><strong>levels</strong><spanclass="classifier">[level0, level1, ..., leveln]</span></dt><dd><p>A list of floating point numbers indicating the contour
levels.</p>
</dd>
<dt><strong>allsegs</strong><spanclass="classifier">[level0segs, level1segs, ...]</span></dt><dd><p>List of all the polygon segments for all the <em>levels</em>.
For contour lines <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">==</span><spanclass="pre">len(levels)</span></code>, and for
filled contour regions <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">=</span><spanclass="pre">len(levels)-1</span></code>. The lists
<dt><strong>allkinds</strong><spanclass="classifier">[level0kinds, level1kinds, ...], optional</span></dt><dd><p>Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">len(allkinds)</span><spanclass="pre">==</span><spanclass="pre">len(allsegs)</span></code>. The lists
<emclass="property">property </em><codeclass="descname">ax</code><aclass="headerlink" href="#matplotlib.contour.ContourSet.ax" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py method">
<dtid="matplotlib.contour.ContourSet.changed">
<codeclass="descname">changed</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.changed"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.changed" title="Permalink to this definition">¶</a></dt>
<dd><p>Call this whenever the mappable is changed to notify all the
<codeclass="descname">find_nearest_contour</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">x</span></em>, <em><spanclass="n">y</span></em>, <em><spanclass="n">indices</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">pixel</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.find_nearest_contour"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.find_nearest_contour" title="Permalink to this definition">¶</a></dt>
<dd><p>Find the point in the contour plot that is closest to <codeclass="docutils literal notranslate"><spanclass="pre">(x,</span><spanclass="pre">y)</span></code>.</p>
<dt><strong>indices</strong><spanclass="classifier">list of int or None, default: None</span></dt><dd><p>Indices of contour levels to consider. If None (the default), all
levels are considered.</p>
</dd>
<dt><strong>pixel</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>If <em>True</em>, measure distance in pixel (screen) space, which is
useful for manual contour labeling; else, measure distance in axes
space.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>contour</strong><spanclass="classifier"><aclass="reference internal" href="collections_api.html#matplotlib.collections.Collection" title="matplotlib.collections.Collection"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Collection</span></code></a></span></dt><dd><p>The contour that is closest to <codeclass="docutils literal notranslate"><spanclass="pre">(x,</span><spanclass="pre">y)</span></code>.</p>
</dd>
<dt><strong>segment</strong><spanclass="classifier">int</span></dt><dd><p>The index of the <aclass="reference internal" href="path_api.html#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> in <em>contour</em> that is closest to
<dt><strong>xmin, ymin</strong><spanclass="classifier">float</span></dt><dd><p>The point in the contour plot that is closest to <codeclass="docutils literal notranslate"><spanclass="pre">(x,</span><spanclass="pre">y)</span></code>.</p>
</dd>
<dt><strong>d</strong><spanclass="classifier">float</span></dt><dd><p>The distance from <codeclass="docutils literal notranslate"><spanclass="pre">(xmin,</span><spanclass="pre">ymin)</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">(x,</span><spanclass="pre">y)</span></code>.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.contour.ContourSet.get_alpha">
<codeclass="descname">get_alpha</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.get_alpha"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.get_alpha" title="Permalink to this definition">¶</a></dt>
<dd><p>Return alpha to be applied to all ContourSet artists.</p>
<codeclass="descname">get_transform</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.get_transform"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.get_transform" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">legend_elements</code><spanclass="sig-paren">(</span><em>self</em>, <em>variable_name='x'</em>, <em>str_format=<class 'str'></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.legend_elements"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.legend_elements" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of artists and labels suitable for passing through
to <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend" title="matplotlib.axes.Axes.legend"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">legend</span></code></a> which represent this ContourSet.</p>
<p>The labels have the form "0 < x <= 1" stating the data ranges which
<dt><strong>variable_name</strong><spanclass="classifier">str</span></dt><dd><p>The string used inside the inequality used on the labels.</p>
</dd>
<dt><strong>str_format</strong><spanclass="classifier">function: float -> str</span></dt><dd><p>Function used to format the numbers in the labels.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>artists</strong><spanclass="classifier">List[<aclass="reference internal" href="artist_api.html#matplotlib.artist.Artist" title="matplotlib.artist.Artist"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Artist</span></code></a>]</span></dt><dd><p>A list of the artists.</p>
</dd>
<dt><strong>labels</strong><spanclass="classifier">List[str]</span></dt><dd><p>A list of the labels.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.contour.ContourSet.set_alpha">
<codeclass="descname">set_alpha</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">alpha</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/contour.html#ContourSet.set_alpha"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.contour.ContourSet.set_alpha" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the alpha blending value for all ContourSet artists.
<em>alpha</em> must be between 0 (transparent) and 1 (opaque).</p>
<dt><strong>levels</strong><spanclass="classifier">[level0, level1, ..., leveln]</span></dt><dd><p>A list of floating point numbers indicating the contour
levels.</p>
</dd>
<dt><strong>allsegs</strong><spanclass="classifier">[level0segs, level1segs, ...]</span></dt><dd><p>List of all the polygon segments for all the <em>levels</em>.
For contour lines <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">==</span><spanclass="pre">len(levels)</span></code>, and for
filled contour regions <codeclass="docutils literal notranslate"><spanclass="pre">len(allsegs)</span><spanclass="pre">=</span><spanclass="pre">len(levels)-1</span></code>. The lists
<dt><strong>allkinds</strong><spanclass="classifier">[level0kinds, level1kinds, ...], optional</span></dt><dd><p>Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">len(allkinds)</span><spanclass="pre">==</span><spanclass="pre">len(allsegs)</span></code>. The lists