<divid="unreleased-message"> You are reading an old version of the documentation (v2.2.4). For the latest version see <ahref="https://matplotlib.org/stable/api/path_api.html">https://matplotlib.org/stable/api/path_api.html</a></div>
<h1>path<aclass="headerlink" href="#path" title="Permalink to this headline">¶</a></h1>
<divclass="section" id="module-matplotlib.path">
<spanid="matplotlib-path"></span><h2><aclass="reference internal" href="#module-matplotlib.path" title="matplotlib.path"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.path</span></code></a><aclass="headerlink" href="#module-matplotlib.path" title="Permalink to this headline">¶</a></h2>
<p>A module for dealing with the polylines used throughout Matplotlib.</p>
<p>The primary class for polyline handling in Matplotlib is <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>. Almost all
vector drawing makes use of <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>s somewhere in the drawing pipeline.</p>
<p>Whilst a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> instance itself cannot be drawn, some <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> subclasses,
such as <aclass="reference internal" href="_as_gen/matplotlib.patches.PathPatch.html#matplotlib.patches.PathPatch" title="matplotlib.patches.PathPatch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">PathPatch</span></code></a> and <aclass="reference internal" href="collections_api.html#matplotlib.collections.PathCollection" title="matplotlib.collections.PathCollection"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">PathCollection</span></code></a>, can be used for convenient <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>
visualisation.</p>
<dlclass="class">
<dtid="matplotlib.path.Path">
<emclass="property">class </em><codeclass="descclassname">matplotlib.path.</code><codeclass="descname">Path</code><spanclass="sig-paren">(</span><em>vertices</em>, <em>codes=None</em>, <em>_interpolation_steps=1</em>, <em>closed=False</em>, <em>readonly=False</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path" title="Permalink to this definition">¶</a></dt>
<p><aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> represents a series of possibly disconnected,
possibly closed, line and curve segments.</p>
<dlclass="docutils">
<dt>The underlying storage is made up of two parallel numpy arrays:</dt>
<dd><ulclass="first last simple">
<li><em>vertices</em>: an Nx2 float array of vertices</li>
<li><em>codes</em>: an N-length uint8 array of vertex types</li>
</ul>
</dd>
</dl>
<p>These two arrays always have the same length in the first
dimension. For example, to represent a cubic curve, you must
provide three vertices as well as three codes <codeclass="docutils literal notranslate"><spanclass="pre">CURVE3</span></code>.</p>
<dd>Draw a line from the current position to the given vertex.</dd>
</dl>
</li>
<li><dlclass="first docutils">
<dt><codeclass="docutils literal notranslate"><spanclass="pre">CURVE3</span></code><spanclass="classifier-delimiter">:</span><spanclass="classifier">1 control point, 1 endpoint</span></dt>
<dd>Draw a quadratic Bezier curve from the current position,
with the given control point, to the given end point.</dd>
</dl>
</li>
<li><dlclass="first docutils">
<dt><codeclass="docutils literal notranslate"><spanclass="pre">CURVE4</span></code><spanclass="classifier-delimiter">:</span><spanclass="classifier">2 control points, 1 endpoint</span></dt>
<dd>Draw a cubic Bezier curve from the current position, with
the given control points, to the given end point.</dd>
<dd>Draw a line segment to the start point of the current
polyline.</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>Users of Path objects should not access the vertices and codes
arrays directly. Instead, they should use <aclass="reference internal" href="#matplotlib.path.Path.iter_segments" title="matplotlib.path.Path.iter_segments"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">iter_segments()</span></code></a>
or <aclass="reference internal" href="#matplotlib.path.Path.cleaned" title="matplotlib.path.Path.cleaned"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">cleaned()</span></code></a> to get the vertex/code pairs. This is important,
since many <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> objects, as an optimization, do not store a
<em>codes</em> at all, but have a default one provided for them by
<dd><pclass="first last">Makes the path behave in an immutable way and sets the vertices
and codes as read-only arrays.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<dlclass="attribute">
<dtid="matplotlib.path.Path.CLOSEPOLY">
<codeclass="descname">CLOSEPOLY</code><emclass="property"> = 79</em><aclass="headerlink" href="#matplotlib.path.Path.CLOSEPOLY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.CURVE3">
<codeclass="descname">CURVE3</code><emclass="property"> = 3</em><aclass="headerlink" href="#matplotlib.path.Path.CURVE3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.CURVE4">
<codeclass="descname">CURVE4</code><emclass="property"> = 4</em><aclass="headerlink" href="#matplotlib.path.Path.CURVE4" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.LINETO">
<codeclass="descname">LINETO</code><emclass="property"> = 2</em><aclass="headerlink" href="#matplotlib.path.Path.LINETO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.MOVETO">
<codeclass="descname">MOVETO</code><emclass="property"> = 1</em><aclass="headerlink" href="#matplotlib.path.Path.MOVETO" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">NUM_VERTICES_FOR_CODE</code><emclass="property"> = {0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 79: 1}</em><aclass="headerlink" href="#matplotlib.path.Path.NUM_VERTICES_FOR_CODE" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary mapping Path codes to the number of vertices that the
code expects.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.STOP">
<codeclass="descname">STOP</code><emclass="property"> = 0</em><aclass="headerlink" href="#matplotlib.path.Path.STOP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.arc">
<emclass="property">classmethod </em><codeclass="descname">arc</code><spanclass="sig-paren">(</span><em>theta1</em>, <em>theta2</em>, <em>n=None</em>, <em>is_wedge=False</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.arc"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.arc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an arc on the unit circle from angle
<em>theta1</em> to angle <em>theta2</em> (in degrees).</p>
<p><em>theta2</em> is unwrapped to produce the shortest arc within 360 degrees.
That is, if <em>theta2</em> > <em>theta1</em> + 360, the arc will be from <em>theta1</em> to
<em>theta2</em> - 360 and not a full circle plus some extra overlap.</p>
<p>If <em>n</em> is provided, it is the number of spline segments to make.
If <em>n</em> is not provided, the number of spline segments is
determined based on the delta between <em>theta1</em> and <em>theta2</em>.</p>
<blockquote>
<div>Masionobe, L. 2003. <aclass="reference external" href="http://www.spaceroots.org/documents/ellipse/index.html">Drawing an elliptical arc using
polylines, quadratic or cubic Bezier curves</a>.</div></blockquote>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.circle">
<emclass="property">classmethod </em><codeclass="descname">circle</code><spanclass="sig-paren">(</span><em>center=(0.0</em>, <em>0.0)</em>, <em>radius=1.0</em>, <em>readonly=False</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.circle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.circle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a Path representing a circle of a given radius and center.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>center</strong><spanclass="classifier-delimiter">:</span><spanclass="classifier">pair of floats</span></dt>
<dd><pclass="first last">The center of the circle. Default <codeclass="docutils literal notranslate"><spanclass="pre">(0,</span><spanclass="pre">0)</span></code>.</p>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>Path instance with cleaned up vertices and codes.</strong></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.clip_to_bbox">
<codeclass="descname">clip_to_bbox</code><spanclass="sig-paren">(</span><em>bbox</em>, <em>inside=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.clip_to_bbox"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.clip_to_bbox" title="Permalink to this definition">¶</a></dt>
<dd><p>Clip the path to the given bounding box.</p>
<p>The path must be made up of one or more closed polygons. This
algorithm will not behave correctly for unclosed paths.</p>
<p>If <em>inside</em> is <aclass="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">True</span></code></a>, clip to the inside of the box, otherwise
to the outside of the box.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.code_type">
<codeclass="descname">code_type</code><aclass="headerlink" href="#matplotlib.path.Path.code_type" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">numpy.uint8</span></code></p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.codes">
<codeclass="descname">codes</code><aclass="headerlink" href="#matplotlib.path.Path.codes" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of codes in the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> as a 1-D numpy array. Each
or <aclass="reference internal" href="#matplotlib.path.Path.CLOSEPOLY" title="matplotlib.path.Path.CLOSEPOLY"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">CLOSEPOLY</span></code></a>. For codes that correspond to more than one
vertex (<aclass="reference internal" href="#matplotlib.path.Path.CURVE3" title="matplotlib.path.Path.CURVE3"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">CURVE3</span></code></a> and <aclass="reference internal" href="#matplotlib.path.Path.CURVE4" title="matplotlib.path.Path.CURVE4"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">CURVE4</span></code></a>), that code will be repeated so
that the length of <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">self.vertices</span></code> and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">self.codes</span></code> is always
the same.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.contains_path">
<codeclass="descname">contains_path</code><spanclass="sig-paren">(</span><em>path</em>, <em>transform=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.contains_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.contains_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns whether this (closed) path completely contains the given path.</p>
<p>If <em>transform</em> is not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the path will be transformed before
performing the test.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.contains_point">
<codeclass="descname">contains_point</code><spanclass="sig-paren">(</span><em>point</em>, <em>transform=None</em>, <em>radius=0.0</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.contains_point"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.contains_point" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns whether the (closed) path contains the given point.</p>
<p>If <em>transform</em> is not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the path will be transformed before
performing the test.</p>
<p><em>radius</em> allows the path to be made slightly larger or smaller.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.contains_points">
<codeclass="descname">contains_points</code><spanclass="sig-paren">(</span><em>points</em>, <em>transform=None</em>, <em>radius=0.0</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.contains_points"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.contains_points" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a bool array which is <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code> if the (closed) path contains
the corresponding point.</p>
<p>If <em>transform</em> is not <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the path will be transformed before
performing the test.</p>
<p><em>radius</em> allows the path to be made slightly larger or smaller.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.copy">
<codeclass="descname">copy</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.path.Path.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a shallow copy of the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>, which will share the
vertices and codes with the source <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.deepcopy">
<codeclass="descname">deepcopy</code><spanclass="sig-paren">(</span><em>memo=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.path.Path.deepcopy" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a deepcopy of the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a>. The <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> will not be
readonly, even if the source <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> is.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.get_extents">
<codeclass="descname">get_extents</code><spanclass="sig-paren">(</span><em>transform=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.get_extents"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.get_extents" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the extents (<em>xmin</em>, <em>ymin</em>, <em>xmax</em>, <em>ymax</em>) of the
path.</p>
<p>Unlike computing the extents on the <em>vertices</em> alone, this
algorithm will take into account the curves and deal with
control points appropriately.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.has_nonfinite">
<codeclass="descname">has_nonfinite</code><aclass="headerlink" href="#matplotlib.path.Path.has_nonfinite" title="Permalink to this definition">¶</a></dt>
<dd><p><aclass="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">True</span></code></a> if the vertices array has nonfinite values.</p>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.hatch">
<emclass="property">classmethod </em><codeclass="descname">hatch</code><spanclass="sig-paren">(</span><em>hatchpattern</em>, <em>density=6</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.hatch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.hatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a hatch specifier, <em>hatchpattern</em>, generates a Path that
can be used in a repeated hatching pattern. <em>density</em> is the
number of lines per unit square.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.interpolated">
<codeclass="descname">interpolated</code><spanclass="sig-paren">(</span><em>steps</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.interpolated"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.interpolated" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a new path resampled to length N x steps. Does not
currently handle interpolating curves.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.intersects_bbox">
<codeclass="descname">intersects_bbox</code><spanclass="sig-paren">(</span><em>bbox</em>, <em>filled=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.intersects_bbox"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.intersects_bbox" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <em>True</em> if this path intersects a given
<p>The bounding box is always considered filled.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.intersects_path">
<codeclass="descname">intersects_path</code><spanclass="sig-paren">(</span><em>other</em>, <em>filled=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.intersects_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.intersects_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <em>True</em> if this path intersects another given path.</p>
<p><em>filled</em>, when True, treats the paths as if they were filled.
That is, if one path completely encloses the other,
<codeclass="descname">iter_segments</code><spanclass="sig-paren">(</span><em>transform=None</em>, <em>remove_nans=True</em>, <em>clip=None</em>, <em>snap=False</em>, <em>stroke_width=1.0</em>, <em>simplify=None</em>, <em>curves=True</em>, <em>sketch=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.iter_segments"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.iter_segments" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates over all of the curve segments in the path. Each
iteration returns a 2-tuple (<em>vertices</em>, <em>code</em>), where
<em>vertices</em> is a sequence of 1 - 3 coordinate pairs, and <em>code</em> is
one of the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> codes.</p>
<p>Additionally, this method can provide a number of standard
<dd><pclass="first last">If True, curve segments will be returned as curve
segments. If False, all curves will be converted to line
segments.</p>
</dd>
<dt><strong>sketch</strong><spanclass="classifier-delimiter">:</span><spanclass="classifier">None or sequence, optional</span></dt>
<dd><pclass="first last">If not None, must be a 3-tuple of the form
(scale, length, randomness), representing the sketch
parameters.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.make_compound_path">
<emclass="property">classmethod </em><codeclass="descname">make_compound_path</code><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.make_compound_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.make_compound_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Make a compound path from a list of Path objects.</p>
<emclass="property">classmethod </em><codeclass="descname">make_compound_path_from_polys</code><spanclass="sig-paren">(</span><em>XY</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.make_compound_path_from_polys"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.make_compound_path_from_polys" title="Permalink to this definition">¶</a></dt>
<dd><p>Make a compound path object to draw a number
of polygons with equal numbers of sides XY is a (numpolys x
numsides x 2) numpy array of vertices. Return object is a
<codeclass="descname">readonly</code><aclass="headerlink" href="#matplotlib.path.Path.readonly" title="Permalink to this definition">¶</a></dt>
<dd><p><aclass="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">True</span></code></a> if the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> is read-only.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.should_simplify">
<codeclass="descname">should_simplify</code><aclass="headerlink" href="#matplotlib.path.Path.should_simplify" title="Permalink to this definition">¶</a></dt>
<dd><p><aclass="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">True</span></code></a> if the vertices array should be simplified.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.simplify_threshold">
<codeclass="descname">simplify_threshold</code><aclass="headerlink" href="#matplotlib.path.Path.simplify_threshold" title="Permalink to this definition">¶</a></dt>
<dd><p>The fraction of a pixel difference below which vertices will
be simplified out.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.to_polygons">
<codeclass="descname">to_polygons</code><spanclass="sig-paren">(</span><em>transform=None</em>, <em>width=0</em>, <em>height=0</em>, <em>closed_only=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.to_polygons"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.to_polygons" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert this path to a list of polygons or polylines. Each
polygon/polyline is an Nx2 array of vertices. In other words,
each polygon has no <codeclass="docutils literal notranslate"><spanclass="pre">MOVETO</span></code> instructions or curves. This
is useful for displaying in backends that do not support
compound paths or Bezier curves, such as GDK.</p>
<p>If <em>width</em> and <em>height</em> are both non-zero then the lines will
be simplified so that vertices outside of (0, 0), (width,
height) will be clipped.</p>
<p>If <em>closed_only</em> is <aclass="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">True</span></code></a> (default), only closed polygons,
with the last point being the same as the first point, will be
returned. Any unclosed polylines in the path will be
explicitly closed. If <em>closed_only</em> is <aclass="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">False</span></code></a>, any unclosed
polygons in the path will be returned as unclosed polygons,
and the closed polygons will be returned explicitly closed by
setting the last point to the same as the first point.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.path.Path.transformed">
<codeclass="descname">transformed</code><spanclass="sig-paren">(</span><em>transform</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.transformed"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.transformed" title="Permalink to this definition">¶</a></dt>
transformed result and automatically update when the
transform changes.</dd>
</dl>
</div>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.unit_circle">
<emclass="property">classmethod </em><codeclass="descname">unit_circle</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_circle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_circle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the readonly <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> of the unit circle.</p>
<p>For most cases, <aclass="reference internal" href="#matplotlib.path.Path.circle" title="matplotlib.path.Path.circle"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">Path.circle()</span></code></a> will be what you want.</p>
<emclass="property">classmethod </em><codeclass="descname">unit_circle_righthalf</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_circle_righthalf"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_circle_righthalf" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> of the right half
of a unit circle. The circle is approximated using cubic Bezier
curves. This uses 4 splines around the circle using the approach
presented here:</p>
<blockquote>
<div>Lancaster, Don. <aclass="reference external" href="http://www.tinaja.com/glib/ellipse4.pdf">Approximating a Circle or an Ellipse Using Four
Bezier Cubic Splines</a>.</div></blockquote>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.unit_rectangle">
<emclass="property">classmethod </em><codeclass="descname">unit_rectangle</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_rectangle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_rectangle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> instance of the unit rectangle
<emclass="property">classmethod </em><codeclass="descname">unit_regular_asterisk</code><spanclass="sig-paren">(</span><em>numVertices</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_regular_asterisk"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_regular_asterisk" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> for a unit regular
asterisk with the given numVertices and radius of 1.0,
<emclass="property">classmethod </em><codeclass="descname">unit_regular_polygon</code><spanclass="sig-paren">(</span><em>numVertices</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_regular_polygon"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_regular_polygon" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> instance for a unit regular
polygon with the given <em>numVertices</em> and radius of 1.0,
centered at (0, 0).</p>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.unit_regular_star">
<emclass="property">classmethod </em><codeclass="descname">unit_regular_star</code><spanclass="sig-paren">(</span><em>numVertices</em>, <em>innerCircle=0.5</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.unit_regular_star"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.unit_regular_star" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> for a unit regular star
with the given numVertices and radius of 1.0, centered at (0,
0).</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.path.Path.vertices">
<codeclass="descname">vertices</code><aclass="headerlink" href="#matplotlib.path.Path.vertices" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of vertices in the <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Path</span></code></a> as an Nx2 numpy array.</p>
</dd></dl>
<dlclass="classmethod">
<dtid="matplotlib.path.Path.wedge">
<emclass="property">classmethod </em><codeclass="descname">wedge</code><spanclass="sig-paren">(</span><em>theta1</em>, <em>theta2</em>, <em>n=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#Path.wedge"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.Path.wedge" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a wedge of the unit circle from angle
<em>theta1</em> to angle <em>theta2</em> (in degrees).</p>
<p><em>theta2</em> is unwrapped to produce the shortest wedge within 360 degrees.
That is, if <em>theta2</em> > <em>theta1</em> + 360, the wedge will be from <em>theta1</em>
to <em>theta2</em> - 360 and not a full circle plus some extra overlap.</p>
<p>If <em>n</em> is provided, it is the number of spline segments to make.
If <em>n</em> is not provided, the number of spline segments is
determined based on the delta between <em>theta1</em> and <em>theta2</em>.</p>
<codeclass="descclassname">matplotlib.path.</code><codeclass="descname">get_path_collection_extents</code><spanclass="sig-paren">(</span><em>master_transform</em>, <em>paths</em>, <em>transforms</em>, <em>offsets</em>, <em>offset_transform</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#get_path_collection_extents"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.get_path_collection_extents" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a sequence of <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> objects,
<aclass="reference internal" href="transformations.html#matplotlib.transforms.Transform" title="matplotlib.transforms.Transform"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Transform</span></code></a> objects and offsets, as
found in a <aclass="reference internal" href="collections_api.html#matplotlib.collections.PathCollection" title="matplotlib.collections.PathCollection"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">PathCollection</span></code></a>,
returns the bounding box that encapsulates all of them.</p>
<p><em>master_transform</em> is a global transformation to apply to all paths</p>
<p><em>paths</em> is a sequence of <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> instances.</p>
<p><em>offsets</em> is a sequence of (x, y) offsets (or an Nx2 array)</p>
<p><em>offset_transform</em> is a <aclass="reference internal" href="transformations.html#matplotlib.transforms.Affine2D" title="matplotlib.transforms.Affine2D"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Affine2D</span></code></a>
to apply to the offsets before applying the offset to the path.</p>
<p>The way that <em>paths</em>, <em>transforms</em> and <em>offsets</em> are combined
follows the same method as for collections. Each is iterated over
independently, so if you have 3 paths, 2 transforms and 1 offset,
their combinations are as follows:</p>
<blockquote>
<div>(A, A, A), (B, B, A), (C, A, A)</div></blockquote>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.path.get_paths_extents">
<codeclass="descclassname">matplotlib.path.</code><codeclass="descname">get_paths_extents</code><spanclass="sig-paren">(</span><em>paths</em>, <em>transforms=[]</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/path.html#get_paths_extents"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.path.get_paths_extents" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a sequence of <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> objects and optional
<p><em>paths</em> is a sequence of <aclass="reference internal" href="#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> instances.</p>
<p><em>transforms</em> is an optional sequence of
<aclass="reference internal" href="transformations.html#matplotlib.transforms.Affine2D" title="matplotlib.transforms.Affine2D"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Affine2D</span></code></a> instances to apply to