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 (v2.1.2). For the latest version see <ahref="https://matplotlib.org/stable/api/axes_api.html">https://matplotlib.org/stable/api/axes_api.html</a></div>
<h1><codeclass="docutils literal"><spanclass="pre">Axes</span></code> class<aclass="headerlink" href="#axes-class" title="Permalink to this headline">¶</a></h1>
<dlclass="class">
<dtid="matplotlib.axes.Axes">
<emclass="property">class </em><codeclass="descclassname">matplotlib.axes.</code><codeclass="descname">Axes</code><spanclass="sig-paren">(</span><em>fig</em>, <em>rect</em>, <em>facecolor=None</em>, <em>frameon=True</em>, <em>sharex=None</em>, <em>sharey=None</em>, <em>label=''</em>, <em>xscale=None</em>, <em>yscale=None</em>, <em>axisbg=None</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.axes.Axes" title="Permalink to this definition">¶</a></dt>
<dd><p>The <aclass="reference internal" href="#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">Axes</span></code></a> contains most of the figure elements:
<aclass="reference internal" href="_as_gen/matplotlib.patches.Polygon.html#matplotlib.patches.Polygon" title="matplotlib.patches.Polygon"><codeclass="xref py py-class docutils literal"><spanclass="pre">Polygon</span></code></a>, etc., and sets the
coordinate system.</p>
<p>The <aclass="reference internal" href="#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">Axes</span></code></a> instance supports callbacks through a callbacks
attribute which is a <aclass="reference internal" href="cbook_api.html#matplotlib.cbook.CallbackRegistry" title="matplotlib.cbook.CallbackRegistry"><codeclass="xref py py-class docutils literal"><spanclass="pre">CallbackRegistry</span></code></a>
instance. The events you can connect to are ‘xlim_changed’ and
‘ylim_changed’ and the callback will be called with func(<em>ax</em>)
where <em>ax</em> is the <aclass="reference internal" href="#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">Axes</span></code></a> instance.</p>
</dd></dl>
<divclass="contents local topic" id="table-of-contents">
<td>Plot the sparsity pattern on a 2-D array.</td>
</tr>
</tbody>
</table>
</div>
<divclass="section" id="unstructured-triangles">
<h3><aclass="toc-backref" href="#id9">Unstructured Triangles</a><aclass="headerlink" href="#unstructured-triangles" title="Permalink to this headline">¶</a></h3>
<td>Draw contours on an unstructured triangular grid.</td>
</tr>
</tbody>
</table>
</div>
<divclass="section" id="text-and-annotations">
<h3><aclass="toc-backref" href="#id10">Text and Annotations</a><aclass="headerlink" href="#text-and-annotations" title="Permalink to this headline">¶</a></h3>
<td>Annotate the point <codeclass="docutils literal"><spanclass="pre">xy</span></code> with text <codeclass="docutils literal"><spanclass="pre">s</span></code>.</td>
<h3><aclass="toc-backref" href="#id16">Axis Limits and direction</a><aclass="headerlink" href="#axis-limits-and-direction" title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref" href="#id17">Axis Labels, title, and legend</a><aclass="headerlink" href="#axis-labels-title-and-legend" title="Permalink to this headline">¶</a></h3>
<td>Return the yaxis scale string: linear, log, logit, symlog</td>
</tr>
</tbody>
</table>
</div>
<divclass="section" id="autoscaling-and-margins">
<h3><aclass="toc-backref" href="#id19">Autoscaling and margins</a><aclass="headerlink" href="#autoscaling-and-margins" title="Permalink to this headline">¶</a></h3>
<td>Use <codeclass="xref py py-meth docutils literal"><spanclass="pre">_aspect()</span></code> and <codeclass="xref py py-meth docutils literal"><spanclass="pre">_adjustable()</span></code> to modify the axes box or the view limits.</td>
<h3><aclass="toc-backref" href="#id21">Ticks and tick labels</a><aclass="headerlink" href="#ticks-and-tick-labels" title="Permalink to this headline">¶</a></h3>
<td>Get the x tick labels as a list of <aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-class docutils literal"><spanclass="pre">Text</span></code></a> instances.</td>
<td>Get the x tick labels as a list of <aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-class docutils literal"><spanclass="pre">Text</span></code></a> instances.</td>
<td>Change the <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.ScalarFormatter" title="matplotlib.ticker.ScalarFormatter"><codeclass="xref py py-obj docutils literal"><spanclass="pre">ScalarFormatter</span></code></a> used by default for linear axes.</td>
<td>Add any <aclass="reference internal" href="artist_api.html#matplotlib.artist.Artist" title="matplotlib.artist.Artist"><codeclass="xref py py-class docutils literal"><spanclass="pre">Artist</span></code></a> to the axes.</td>
<td>Add a <aclass="reference internal" href="collections_api.html#matplotlib.collections.Collection" title="matplotlib.collections.Collection"><codeclass="xref py py-class docutils literal"><spanclass="pre">Collection</span></code></a> instance to the axes.</td>
<td>Add a <aclass="reference internal" href="container_api.html#matplotlib.container.Container" title="matplotlib.container.Container"><codeclass="xref py py-class docutils literal"><spanclass="pre">Container</span></code></a> instance to the axes.</td>
<td>Add a <aclass="reference internal" href="image_api.html#matplotlib.image.AxesImage" title="matplotlib.image.AxesImage"><codeclass="xref py py-class docutils literal"><spanclass="pre">AxesImage</span></code></a> to the axes.</td>
<td>Add a <aclass="reference internal" href="_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D" title="matplotlib.lines.Line2D"><codeclass="xref py py-class docutils literal"><spanclass="pre">Line2D</span></code></a> to the list of plot</td>
<td>Add a <aclass="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch" title="matplotlib.patches.Patch"><codeclass="xref py py-class docutils literal"><spanclass="pre">Patch</span></code></a><em>p</em> to the list of axes patches; the clipbox will be set to the Axes clipping box.</td>