<divid="unreleased-message"> You are reading an old version of the documentation (v3.3.2). For the latest version see <ahref="https://matplotlib.org/stable/api/bezier_api.html">https://matplotlib.org/stable/api/bezier_api.html</a></div>
<spanid="matplotlib-bezier"></span><h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.bezier</span></code><aclass="headerlink" href="#module-matplotlib.bezier" title="Permalink to this headline">¶</a></h1>
<p>A module providing some utility functions regarding Bezier path manipulation.</p>
<dlclass="py class">
<dtid="matplotlib.bezier.BezierSegment">
<emclass="property">class </em><codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">BezierSegment</code><spanclass="sig-paren">(</span><em><spanclass="n">control_points</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#BezierSegment"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.BezierSegment" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">axis_aligned_extrema</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#BezierSegment.axis_aligned_extrema"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.axis_aligned_extrema" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the dimension and location of the curve's interior extrema.</p>
<p>The extrema are the points along the curve where one of its partial
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>dims</strong><spanclass="classifier">int, array_like</span></dt><dd><p>Index <spanclass="math notranslate nohighlight">\(i\)</span> of the partial derivative which is zero at each
interior extrema.</p>
</dd>
<dt><strong>dzeros</strong><spanclass="classifier">float, array_like</span></dt><dd><p>Of same size as dims. The <spanclass="math notranslate nohighlight">\(t\)</span> such that <spanclass="math notranslate nohighlight">\(d/dx_i B(t) =
<emclass="property">property </em><codeclass="descname">control_points</code><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.control_points" title="Permalink to this definition">¶</a></dt>
<dd><p>The control points of the curve.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.bezier.BezierSegment.degree">
<emclass="property">property </em><codeclass="descname">degree</code><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.degree" title="Permalink to this definition">¶</a></dt>
<dd><p>Degree of the polynomial. One less the number of control points.</p>
<emclass="property">property </em><codeclass="descname">dimension</code><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.dimension" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">point_at_t</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">t</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#BezierSegment.point_at_t"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.point_at_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate curve at a single point <em>t</em>. Returns a Tuple[float*d].</p>
<emclass="property">property </em><codeclass="descname">polynomial_coefficients</code><aclass="headerlink" href="#matplotlib.bezier.BezierSegment.polynomial_coefficients" title="Permalink to this definition">¶</a></dt>
<dd><p>The polynomial coefficients of the Bezier curve.</p>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt>float, (n+1, d) array_like</dt><dd><p>Coefficients after expanding in polynomial basis, where <spanclass="math notranslate nohighlight">\(n\)</span>
is the degree of the bezier curve and <spanclass="math notranslate nohighlight">\(d\)</span> its dimension.
These are the numbers (<spanclass="math notranslate nohighlight">\(C_j\)</span>) such that the curve can be
written <spanclass="math notranslate nohighlight">\(\sum_{j=0}^n C_j t^j\)</span>.</p>
<emclass="property">exception </em><codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">NonIntersectingPathException</code><aclass="reference internal" href="../_modules/matplotlib/bezier.html#NonIntersectingPathException"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.NonIntersectingPathException" title="Permalink to this definition">¶</a></dt>
<dt><strong>dx1, dy1, dx2, dy2</strong><spanclass="classifier">float</span></dt><dd><p>The gradients <em>dy</em>/<em>dx</em> of the two lines.</p>
</dd>
<dt><strong>tolerance</strong><spanclass="classifier">float</span></dt><dd><p>The angular tolerance in radians up to which the lines are considered
parallel.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt>is_parallel</dt><dd><ulclass="simple">
<li>1 if two lines are parallel in same direction.</li>
<li>-1 if two lines are parallel in opposite direction.</li>
<li>False otherwise.</li>
</ul>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.concatenate_paths">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">concatenate_paths</code><spanclass="sig-paren">(</span><em><spanclass="n">paths</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#concatenate_paths"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.concatenate_paths" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Deprecated</em>] Concatenate a list of paths into a single path.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.3.</span></p>
<dt><strong>bezier_point_at_t</strong><spanclass="classifier">callable</span></dt><dd><p>A function returning x, y coordinates of the Bezier at parameter <em>t</em>.
<dt><strong>inside_closedpath</strong><spanclass="classifier">callable</span></dt><dd><p>A function returning True if a given point (x, y) is inside the
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">find_control_points</code><spanclass="sig-paren">(</span><em><spanclass="n">c1x</span></em>, <em><spanclass="n">c1y</span></em>, <em><spanclass="n">mmx</span></em>, <em><spanclass="n">mmy</span></em>, <em><spanclass="n">c2x</span></em>, <em><spanclass="n">c2y</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#find_control_points"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.find_control_points" title="Permalink to this definition">¶</a></dt>
<dd><p>Find control points of the Bezier curve passing through (<em>c1x</em>, <em>c1y</em>),
(<em>mmx</em>, <em>mmy</em>), and (<em>c2x</em>, <em>c2y</em>), at parametric values 0, 0.5, and 1.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.get_cos_sin">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">get_cos_sin</code><spanclass="sig-paren">(</span><em><spanclass="n">x0</span></em>, <em><spanclass="n">y0</span></em>, <em><spanclass="n">x1</span></em>, <em><spanclass="n">y1</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#get_cos_sin"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.get_cos_sin" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.get_intersection">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">get_intersection</code><spanclass="sig-paren">(</span><em><spanclass="n">cx1</span></em>, <em><spanclass="n">cy1</span></em>, <em><spanclass="n">cos_t1</span></em>, <em><spanclass="n">sin_t1</span></em>, <em><spanclass="n">cx2</span></em>, <em><spanclass="n">cy2</span></em>, <em><spanclass="n">cos_t2</span></em>, <em><spanclass="n">sin_t2</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#get_intersection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.get_intersection" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the intersection between the line through (<em>cx1</em>, <em>cy1</em>) at angle
<em>t1</em> and the line through (<em>cx2</em>, <em>cy2</em>) at angle <em>t2</em>.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.get_normal_points">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">get_normal_points</code><spanclass="sig-paren">(</span><em><spanclass="n">cx</span></em>, <em><spanclass="n">cy</span></em>, <em><spanclass="n">cos_t</span></em>, <em><spanclass="n">sin_t</span></em>, <em><spanclass="n">length</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#get_normal_points"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.get_normal_points" title="Permalink to this definition">¶</a></dt>
<dd><p>For a line passing through (<em>cx</em>, <em>cy</em>) and having an angle <em>t</em>, return
locations of the two points located along its perpendicular line at the
distance of <em>length</em>.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.get_parallels">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">get_parallels</code><spanclass="sig-paren">(</span><em><spanclass="n">bezier2</span></em>, <em><spanclass="n">width</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#get_parallels"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.get_parallels" title="Permalink to this definition">¶</a></dt>
<dd><p>Given the quadratic Bezier control points <em>bezier2</em>, returns
control points of quadratic Bezier lines roughly parallel to given
one separated by <em>width</em>.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.inside_circle">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">inside_circle</code><spanclass="sig-paren">(</span><em><spanclass="n">cx</span></em>, <em><spanclass="n">cy</span></em>, <em><spanclass="n">r</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#inside_circle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.inside_circle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a function that checks whether a point is in a circle with center
(<em>cx</em>, <em>cy</em>) and radius <em>r</em>.</p>
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">make_path_regular</code><spanclass="sig-paren">(</span><em><spanclass="n">p</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#make_path_regular"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.make_path_regular" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Deprecated</em>] If the <codeclass="docutils literal notranslate"><spanclass="pre">codes</span></code> attribute of <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><em>p</em> is None, return a copy of <em>p</em>
with <codeclass="docutils literal notranslate"><spanclass="pre">codes</span></code> set to (MOVETO, LINETO, LINETO, ..., LINETO); otherwise
return <em>p</em> itself.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.3.</span></p>
</div>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.make_wedged_bezier2">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">make_wedged_bezier2</code><spanclass="sig-paren">(</span><em><spanclass="n">bezier2</span></em>, <em><spanclass="n">width</span></em>, <em><spanclass="n">w1</span><spanclass="o">=</span><spanclass="default_value">1.0</span></em>, <em><spanclass="n">wm</span><spanclass="o">=</span><spanclass="default_value">0.5</span></em>, <em><spanclass="n">w2</span><spanclass="o">=</span><spanclass="default_value">0.0</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#make_wedged_bezier2"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.make_wedged_bezier2" title="Permalink to this definition">¶</a></dt>
<dd><p>Being similar to get_parallels, returns control points of two quadratic
Bezier lines having a width roughly parallel to given one separated by
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">split_bezier_intersecting_with_closedpath</code><spanclass="sig-paren">(</span><em><spanclass="n">bezier</span></em>, <em><spanclass="n">inside_closedpath</span></em>, <em><spanclass="n">tolerance</span><spanclass="o">=</span><spanclass="default_value">0.01</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#split_bezier_intersecting_with_closedpath"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.split_bezier_intersecting_with_closedpath" title="Permalink to this definition">¶</a></dt>
<dd><p>Split a Bezier curve into two at the intersection with a closed path.</p>
<dt><strong>bezier</strong><spanclass="classifier">array-like(N, 2)</span></dt><dd><p>Control points of the Bezier segment. See <aclass="reference internal" href="#matplotlib.bezier.BezierSegment" title="matplotlib.bezier.BezierSegment"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">BezierSegment</span></code></a>.</p>
</dd>
<dt><strong>inside_closedpath</strong><spanclass="classifier">callable</span></dt><dd><p>A function returning True if a given point (x, y) is inside the
closed path. See also <aclass="reference internal" href="#matplotlib.bezier.find_bezier_t_intersecting_with_closedpath" title="matplotlib.bezier.find_bezier_t_intersecting_with_closedpath"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">find_bezier_t_intersecting_with_closedpath</span></code></a>.</p>
</dd>
<dt><strong>tolerance</strong><spanclass="classifier">float</span></dt><dd><p>The tolerance for the intersection. See also
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt>left, right</dt><dd><p>Lists of control points for the two Bezier segments.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.split_de_casteljau">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">split_de_casteljau</code><spanclass="sig-paren">(</span><em><spanclass="n">beta</span></em>, <em><spanclass="n">t</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#split_de_casteljau"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.split_de_casteljau" title="Permalink to this definition">¶</a></dt>
<dd><p>Split a Bezier segment defined by its control points <em>beta</em> into two
separate segments divided at <em>t</em> and return their control points.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.bezier.split_path_inout">
<codeclass="descclassname">matplotlib.bezier.</code><codeclass="descname">split_path_inout</code><spanclass="sig-paren">(</span><em><spanclass="n">path</span></em>, <em><spanclass="n">inside</span></em>, <em><spanclass="n">tolerance</span><spanclass="o">=</span><spanclass="default_value">0.01</span></em>, <em><spanclass="n">reorder_inout</span><spanclass="o">=</span><spanclass="default_value">False</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/bezier.html#split_path_inout"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.bezier.split_path_inout" title="Permalink to this definition">¶</a></dt>
<dd><p>Divide a path into two segments at the point where <codeclass="docutils literal notranslate"><spanclass="pre">inside(x,</span><spanclass="pre">y)</span></code> becomes