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.0). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<spanid="sphx-glr-gallery-api-agg-oo-sgskip-py"></span><h1>The object-oriented interface<aclass="headerlink" href="#the-object-oriented-interface" title="Permalink to this headline">¶</a></h1>
<p>A pure OO (look Ma, no pyplot!) example using the agg backend.</p>
<spanclass="kn">from</span><spanclass="nn">matplotlib.figure</span><spanclass="kn">import</span><ahref="../../api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure" title="View documentation for matplotlib.figure.Figure"><spanclass="n">Figure</span></a>
<spanclass="n">fig</span><spanclass="o">=</span><ahref="../../api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure" title="View documentation for matplotlib.figure.Figure"><spanclass="n">Figure</span></a><spanclass="p">()</span>
<spanclass="c1"># A canvas must be manually attached to the figure (pyplot would automatically</span>
<spanclass="c1"># do it). This is done by instanciating the canvas with the figure as</span>