<divid="unreleased-message"> You are reading an old version of the documentation (v3.4.3). For the latest version see <ahref="https://matplotlib.org/stable/api/patheffects_api.html">https://matplotlib.org/stable/api/patheffects_api.html</a></div>
<spanid="matplotlib-patheffects"></span><h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.patheffects</span></code><aclass="headerlink" href="#module-matplotlib.patheffects" title="Permalink to this headline">¶</a></h1>
<p>Defines classes for path effects. The path effects are supported in <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>,
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">AbstractPathEffect</code><spanclass="sig-paren">(</span><em><spanclass="n">offset</span><spanclass="o">=</span><spanclass="default_value">(0.0, 0.0)</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#AbstractPathEffect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.AbstractPathEffect" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (0, 0)</span></dt><dd><p>The (x, y) offset to apply to the path, measured in points.</p>
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">renderer</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">tpath</span></em>, <em><spanclass="n">affine</span></em>, <em><spanclass="n">rgbFace</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#AbstractPathEffect.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.AbstractPathEffect.draw_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Derived should override this method. The arguments are the same
as <aclass="reference internal" href="backend_bases_api.html#matplotlib.backend_bases.RendererBase.draw_path" title="matplotlib.backend_bases.RendererBase.draw_path"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">matplotlib.backend_bases.RendererBase.draw_path()</span></code></a>
except the first argument is a renderer.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.patheffects.Normal">
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">Normal</code><spanclass="sig-paren">(</span><em><spanclass="n">offset</span><spanclass="o">=</span><spanclass="default_value">(0.0, 0.0)</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#Normal"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.Normal" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (0, 0)</span></dt><dd><p>The (x, y) offset to apply to the path, measured in points.</p>
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">PathEffectRenderer</code><spanclass="sig-paren">(</span><em><spanclass="n">path_effects</span></em>, <em><spanclass="n">renderer</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathEffectRenderer"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathEffectRenderer" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">copy_with_path_effect</code><spanclass="sig-paren">(</span><em><spanclass="n">path_effects</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathEffectRenderer.copy_with_path_effect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathEffectRenderer.copy_with_path_effect" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">draw_markers</code><spanclass="sig-paren">(</span><em><spanclass="n">gc</span></em>, <em><spanclass="n">marker_path</span></em>, <em><spanclass="n">marker_trans</span></em>, <em><spanclass="n">path</span></em>, <em><spanclass="o">*</span><spanclass="n">args</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathEffectRenderer.draw_markers"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathEffectRenderer.draw_markers" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw a marker at each of <em>path</em>'s vertices (excluding control points).</p>
<p>This provides a fallback implementation of draw_markers that
makes multiple calls to <aclass="reference internal" href="#matplotlib.patheffects.PathEffectRenderer.draw_path" title="matplotlib.patheffects.PathEffectRenderer.draw_path"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path()</span></code></a>. Some backends may
want to override this method in order to draw the marker only
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">gc</span></em>, <em><spanclass="n">tpath</span></em>, <em><spanclass="n">affine</span></em>, <em><spanclass="n">rgbFace</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathEffectRenderer.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathEffectRenderer.draw_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw a <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> instance using the given affine transform.</p>
<codeclass="descname">draw_path_collection</code><spanclass="sig-paren">(</span><em><spanclass="n">gc</span></em>, <em><spanclass="n">master_transform</span></em>, <em><spanclass="n">paths</span></em>, <em><spanclass="o">*</span><spanclass="n">args</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathEffectRenderer.draw_path_collection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathEffectRenderer.draw_path_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw a collection of paths selecting drawing properties from
the lists <em>facecolors</em>, <em>edgecolors</em>, <em>linewidths</em>,
<em>linestyles</em> and <em>antialiaseds</em>. <em>offsets</em> is a list of
offsets to apply to each of the paths. The offsets in
<em>offsets</em> are first transformed by <em>offsetTrans</em> before being
applied.</p>
<p><em>offset_position</em> may be either "screen" or "data" depending on the
space that the offsets are in; "data" is deprecated.</p>
<p>This provides a fallback implementation of
<aclass="reference internal" href="#matplotlib.patheffects.PathEffectRenderer.draw_path_collection" title="matplotlib.patheffects.PathEffectRenderer.draw_path_collection"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path_collection()</span></code></a> that makes multiple calls to
<aclass="reference internal" href="#matplotlib.patheffects.PathEffectRenderer.draw_path" title="matplotlib.patheffects.PathEffectRenderer.draw_path"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path()</span></code></a>. Some backends may want to override this in
order to render each set of path data only once, and then
reference that path multiple times with the different offsets,
colors, styles etc. The generator methods
<codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">_iter_collection_raw_paths()</span></code> and
<codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">_iter_collection()</span></code> are provided to help with (and
standardize) the implementation across backends. It is highly
recommended to use those generators, so that changes to the
behavior of <aclass="reference internal" href="#matplotlib.patheffects.PathEffectRenderer.draw_path_collection" title="matplotlib.patheffects.PathEffectRenderer.draw_path_collection"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path_collection()</span></code></a> can be made globally.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.patheffects.PathPatchEffect">
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">PathPatchEffect</code><spanclass="sig-paren">(</span><em><spanclass="n">offset</span><spanclass="o">=</span><spanclass="default_value">(0, 0)</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/patheffects.html#PathPatchEffect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.patheffects.PathPatchEffect" title="Permalink to this definition">¶</a></dt>
<p>Draws a <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> instance whose Path comes from the original
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (0, 0)</span></dt><dd><p>The (x, y) offset to apply to the path, in points.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>All keyword arguments are passed through to the
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (2, -2)</span></dt><dd><p>The (x, y) offset to apply to the path, in points.</p>
A value of <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> takes the original artist's color
with a scale factor of <em>rho</em>.</p>
</dd>
<dt><strong>alpha</strong><spanclass="classifier">float, default: 0.3</span></dt><dd><p>The alpha transparency of the created shadow patch.</p>
</dd>
<dt><strong>rho</strong><spanclass="classifier">float, default: 0.3</span></dt><dd><p>A scale factor to apply to the rgbFace color if <em>shadow_color</em>
is <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Extra keywords are stored and passed through to
<dt><strong>rho</strong><spanclass="classifier">float, default: 0.3</span></dt><dd><p>A scale factor to apply to the rgbFace color if <em>shadow_rgbFace</em>
is not specified.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Extra keywords are stored and passed through to
<p>A line-based PathEffect which draws a path with a ticked style.</p>
<p>This line style is frequently used to represent constraints in
optimization. The ticks may be used to indicate that one side
of the line is invalid or to represent a closed boundary of a
domain (i.e. a wall or the edge of a pipe).</p>
<p>The spacing, length, and angle of ticks can be controlled.</p>
<p>This line style is sometimes referred to as a hatched line.</p>
<p>See also the <aclass="reference internal" href="../gallery/lines_bars_and_markers/lines_with_ticks_demo.html"><spanclass="doc">contour demo example</span></a>.</p>
<p>See also the <aclass="reference internal" href="../gallery/images_contours_and_fields/contours_in_optimization_demo.html"><spanclass="doc">contours in optimization example</span></a>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (0, 0)</span></dt><dd><p>The (x, y) offset to apply to the path, in points.</p>
</dd>
<dt><strong>spacing</strong><spanclass="classifier">float, default: 10.0</span></dt><dd><p>The spacing between ticks in points.</p>
</dd>
<dt><strong>angle</strong><spanclass="classifier">float, default: 45.0</span></dt><dd><p>The angle between the path and the tick in degrees. The angle
is measured as if you were an ant walking along the curve, with
zero degrees pointing directly ahead, 90 to your left, -90
to your right, and 180 behind you.</p>
</dd>
<dt><strong>length</strong><spanclass="classifier">float, default: 1.414</span></dt><dd><p>The length of the tick relative to spacing.
Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0
when angle=90 and length=2.0 when angle=60.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Extra keywords are stored and passed through to
<dt><strong>rho</strong><spanclass="classifier">float, default: 0.3</span></dt><dd><p>A scale factor to apply to the rgbFace color if <em>shadow_rgbFace</em>
is not specified.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Extra keywords are stored and passed through to
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">renderer</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">tpath</span></em>, <em><spanclass="n">affine</span></em>, <em><spanclass="n">rgbFace</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.patheffects.withSimplePatchShadow.draw_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Overrides the standard draw_path to add the shadow offset and
necessary color changes for the shadow.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.patheffects.withStroke">
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">withStroke</code><spanclass="sig-paren">(</span><em><spanclass="n">offset</span><spanclass="o">=</span><spanclass="default_value">(0, 0)</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.patheffects.withStroke" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">renderer</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">tpath</span></em>, <em><spanclass="n">affine</span></em>, <em><spanclass="n">rgbFace</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.patheffects.withStroke.draw_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw the path with updated gc.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.patheffects.withTickedStroke">
<emclass="property">class </em><codeclass="descclassname">matplotlib.patheffects.</code><codeclass="descname">withTickedStroke</code><spanclass="sig-paren">(</span><em><spanclass="n">offset</span><spanclass="o">=</span><spanclass="default_value">(0, 0)</span></em>, <em><spanclass="n">spacing</span><spanclass="o">=</span><spanclass="default_value">10.0</span></em>, <em><spanclass="n">angle</span><spanclass="o">=</span><spanclass="default_value">45.0</span></em>, <em><spanclass="n">length</span><spanclass="o">=</span><spanclass="default_value">1.4142135623730951</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.patheffects.withTickedStroke" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>offset</strong><spanclass="classifier">(float, float), default: (0, 0)</span></dt><dd><p>The (x, y) offset to apply to the path, in points.</p>
</dd>
<dt><strong>spacing</strong><spanclass="classifier">float, default: 10.0</span></dt><dd><p>The spacing between ticks in points.</p>
</dd>
<dt><strong>angle</strong><spanclass="classifier">float, default: 45.0</span></dt><dd><p>The angle between the path and the tick in degrees. The angle
is measured as if you were an ant walking along the curve, with
zero degrees pointing directly ahead, 90 to your left, -90
to your right, and 180 behind you.</p>
</dd>
<dt><strong>length</strong><spanclass="classifier">float, default: 1.414</span></dt><dd><p>The length of the tick relative to spacing.
Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0
when angle=90 and length=2.0 when angle=60.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Extra keywords are stored and passed through to
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">renderer</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">tpath</span></em>, <em><spanclass="n">affine</span></em>, <em><spanclass="n">rgbFace</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.patheffects.withTickedStroke.draw_path" title="Permalink to this definition">¶</a></dt>