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.2.4). 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 notranslate"><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>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/axes/_axes.html#Axes"><spanclass="viewcode-link">[source]</span></a><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 notranslate"><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 notranslate"><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 notranslate"><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 notranslate"><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 notranslate"><spanclass="pre">Axes</span></code></a> instance.</p>
<p>Build an <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes</span></code> instance in
<aclass="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Figure</span></code></a><em>fig</em> with
<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 notranslate"><spanclass="pre">xy</span></code> with text <codeclass="docutils literal notranslate"><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>
<td>Update the datalim to include the given <aclass="reference internal" href="transformations.html#matplotlib.transforms.Bbox" title="matplotlib.transforms.Bbox"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Bbox</span></code></a><em>bounds</em></td>
<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 <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Legend</span></code> instance, or None if no legend is defined.</td>
<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>
<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 notranslate"><spanclass="pre">Text</span></code></a> instances.</td>
<td>Get the y 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 notranslate"><spanclass="pre">Text</span></code></a> instances.</td>