<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/spines_api.html">https://matplotlib.org/stable/api/spines_api.html</a></div>
<spanid="matplotlib-spines"></span><h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.spines</span></code><aclass="headerlink" href="#module-matplotlib.spines" title="Permalink to this headline">¶</a></h1>
<dlclass="py class">
<dtid="matplotlib.spines.Spine">
<emclass="property">class </em><codeclass="descclassname">matplotlib.spines.</code><codeclass="descname">Spine</code><spanclass="sig-paren">(</span><em><spanclass="n">axes</span></em>, <em><spanclass="n">spine_type</span></em>, <em><spanclass="n">path</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine" title="Permalink to this definition">¶</a></dt>
<p>An axis spine -- the line noting the data area boundaries.</p>
<p>Spines are the lines connecting the axis tick marks and noting the
boundaries of the data area. They can be placed at arbitrary
positions. See <aclass="reference internal" href="#matplotlib.spines.Spine.set_position" title="matplotlib.spines.Spine.set_position"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_position</span></code></a> for more information.</p>
<p>The default position is <codeclass="docutils literal notranslate"><spanclass="pre">('outward',</span><spanclass="pre">0)</span></code>.</p>
<p>Spines are subclasses of <aclass="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch" title="matplotlib.patches.Patch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Patch</span></code></a>, and inherit much of their behavior.</p>
<p>Spines draw a line, a circle, or an arc depending if
<aclass="reference internal" href="#matplotlib.spines.Spine.set_patch_arc" title="matplotlib.spines.Spine.set_patch_arc"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_patch_arc</span></code></a> has been called. Line-like is the default.</p>
<emclass="property">classmethod </em><codeclass="descname">arc_spine</code><spanclass="sig-paren">(</span><em><spanclass="n">axes</span></em>, <em><spanclass="n">spine_type</span></em>, <em><spanclass="n">center</span></em>, <em><spanclass="n">radius</span></em>, <em><spanclass="n">theta1</span></em>, <em><spanclass="n">theta2</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.arc_spine"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.arc_spine" title="Permalink to this definition">¶</a></dt>
<dd><p>Create and return an arc <aclass="reference internal" href="#matplotlib.spines.Spine" title="matplotlib.spines.Spine"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Spine</span></code></a>.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.circular_spine">
<emclass="property">classmethod </em><codeclass="descname">circular_spine</code><spanclass="sig-paren">(</span><em><spanclass="n">axes</span></em>, <em><spanclass="n">center</span></em>, <em><spanclass="n">radius</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.circular_spine"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.circular_spine" title="Permalink to this definition">¶</a></dt>
<dd><p>Create and return a circular <aclass="reference internal" href="#matplotlib.spines.Spine" title="matplotlib.spines.Spine"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Spine</span></code></a>.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.cla">
<codeclass="descname">cla</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.cla"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.cla" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear the current spine.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.draw">
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">renderer</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.draw"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.draw" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw the Artist (and its children) using the given renderer.</p>
<p>This has no effect if the artist is not visible (<aclass="reference internal" href="_as_gen/matplotlib.artist.Artist.get_visible.html#matplotlib.artist.Artist.get_visible" title="matplotlib.artist.Artist.get_visible"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Artist.get_visible</span></code></a>
<p>This method is overridden in the Artist subclasses.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.get_bounds">
<codeclass="descname">get_bounds</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_bounds"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_bounds" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_patch_transform</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_patch_transform"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_patch_transform" title="Permalink to this definition">¶</a></dt>
<p>For example, one may define a patch of a circle which represents a
radius of 5 by providing coordinates for a unit circle, and a
transform which scales the coordinates (the patch coordinate) by 5.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.get_path">
<codeclass="descname">get_path</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the path of this patch.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.get_position">
<codeclass="descname">get_position</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_position"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_position" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the spine position.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.get_smart_bounds">
<codeclass="descname">get_smart_bounds</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_smart_bounds"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_smart_bounds" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Deprecated</em>] Return whether the spine has smart bounds.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></p>
<codeclass="descname">get_spine_transform</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_spine_transform"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_spine_transform" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_window_extent</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">renderer</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.get_window_extent"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.get_window_extent" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the window extent of the spines in display space, including
<emclass="property">classmethod </em><codeclass="descname">linear_spine</code><spanclass="sig-paren">(</span><em><spanclass="n">axes</span></em>, <em><spanclass="n">spine_type</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.linear_spine"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.linear_spine" title="Permalink to this definition">¶</a></dt>
<dd><p>Create and return a linear <aclass="reference internal" href="#matplotlib.spines.Spine" title="matplotlib.spines.Spine"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Spine</span></code></a>.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.register_axis">
<codeclass="descname">register_axis</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">axis</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.register_axis"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.register_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>Register an axis.</p>
<p>An axis should be registered with its corresponding spine from
the Axes instance. This allows the spine to clear any axis
properties when needed.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_bounds">
<codeclass="descname">set_bounds</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">low</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">high</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_bounds"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_bounds" 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>low</strong><spanclass="classifier">float or None, optional</span></dt><dd><p>The lower spine bound. Passing <em>None</em> leaves the limit unchanged.</p>
<p>The bounds may also be passed as the tuple (<em>low</em>, <em>high</em>) as the
first positional argument.</p>
</dd>
<dt><strong>high</strong><spanclass="classifier">float or None, optional</span></dt><dd><p>The higher spine bound. Passing <em>None</em> leaves the limit unchanged.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_color">
<codeclass="descname">set_color</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">c</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_color"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_color" title="Permalink to this definition">¶</a></dt>
<p>This method does not modify the facecolor (which defaults to "none"),
unlike the <aclass="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_color" title="matplotlib.patches.Patch.set_color"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Patch.set_color</span></code></a> method defined in the parent class. Use
<aclass="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_facecolor" title="matplotlib.patches.Patch.set_facecolor"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Patch.set_facecolor</span></code></a> to set the facecolor.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_patch_arc">
<codeclass="descname">set_patch_arc</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">center</span></em>, <em><spanclass="n">radius</span></em>, <em><spanclass="n">theta1</span></em>, <em><spanclass="n">theta2</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_patch_arc"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_patch_arc" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the spine to be arc-like.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_patch_circle">
<codeclass="descname">set_patch_circle</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">center</span></em>, <em><spanclass="n">radius</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_patch_circle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_patch_circle" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the spine to be circular.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_patch_line">
<codeclass="descname">set_patch_line</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_patch_line"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_patch_line" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the spine to be linear.</p>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_position">
<codeclass="descname">set_position</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">position</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_position"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_position" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the position of the spine.</p>
<p>Spine position is specified by a 2 tuple of (position type,
amount). The position types are:</p>
<ulclass="simple">
<li>'outward': place the spine out from the data area by the specified
number of points. (Negative values place the spine inwards.)</li>
<li>'axes': place the spine at the specified Axes coordinate (0 to 1).</li>
<li>'data': place the spine at the specified data coordinate.</li>
</ul>
<p>Additionally, shorthand notations define a special positions:</p>
<ulclass="simple">
<li>'center' -> ('axes', 0.5)</li>
<li>'zero' -> ('data', 0.0)</li>
</ul>
</dd></dl>
<dlclass="py method">
<dtid="matplotlib.spines.Spine.set_smart_bounds">
<codeclass="descname">set_smart_bounds</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">value</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/spines.html#Spine.set_smart_bounds"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.spines.Spine.set_smart_bounds" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Deprecated</em>] Set the spine and associated axis to have smart bounds.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></p>