<divid="unreleased-message"> You are reading an old version of the documentation (v3.2.0). For the latest version see <ahref="https://matplotlib.org/stable/api/backend_agg_api.html">https://matplotlib.org/stable/api/backend_agg_api.html</a></div>
<codeclass="descclassname">matplotlib.backends.backend_agg.</code><codeclass="descname">FigureCanvas</code><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvas" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_agg.</code><codeclass="descname">FigureCanvasAgg</code><spanclass="sig-paren">(</span><em>figure</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">buffer_rgba</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.buffer_rgba"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.buffer_rgba" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the image as a memoryview to the renderer's buffer.</p>
<p><aclass="reference internal" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.draw" title="matplotlib.backends.backend_agg.FigureCanvasAgg.draw"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">draw</span></code></a> must be called at least once before this function will work and
to update the renderer for any subsequent changes to the Figure.</p>
<codeclass="descname">copy_from_bbox</code><spanclass="sig-paren">(</span><em>self</em>, <em>bbox</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.copy_from_bbox"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.copy_from_bbox" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.draw"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.draw" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_renderer</code><spanclass="sig-paren">(</span><em>self</em>, <em>cleared=False</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.get_renderer"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.get_renderer" 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>filename_or_obj</strong><spanclass="classifier">str or PathLike or file-like object</span></dt><dd><p>The file to write to.</p>
</dd>
<dt><strong>metadata</strong><spanclass="classifier">dict, optional</span></dt><dd><p>Metadata in the PNG file as key-value pairs of bytes or latin-1
encodable strings.
According to the PNG specification, keys must be shorter than 79
chars.</p>
<p>The <aclass="reference external" href="https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords">PNG specification</a> defines some common keywords that may be
used as appropriate:</p>
<ulclass="simple">
<li>Title: Short (one line) title or caption for image.</li>
<li>Author: Name of image's creator.</li>
<li>Description: Description of image (possibly long).</li>
<li>Copyright: Copyright notice.</li>
<li>Creation Time: Time of original image creation
(usually RFC 1123 format).</li>
<li>Software: Software used to create the image.</li>
<li>Disclaimer: Legal disclaimer.</li>
<li>Warning: Warning of nature of content.</li>
<li>Source: Device used to create the image.</li>
<li>Comment: Miscellaneous comment;
conversion from other image format.</li>
</ul>
<p>Other keywords may be invented for other purposes.</p>
<p>If 'Software' is not given, an autogenerated value for matplotlib
will be used.</p>
<p>For more details see the <aclass="reference external" href="https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords">PNG specification</a>.</p>
</dd>
<dt><strong>pil_kwargs</strong><spanclass="classifier">dict, optional</span></dt><dd><p>If set to a non-None value, use Pillow to save the figure instead
of Matplotlib's builtin PNG support, and pass these keyword
arguments to <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">PIL.Image.save</span></code>.</p>
<p>If the 'pnginfo' key is present, it completely overrides
<em>metadata</em>, including the default 'Software' key.</p>
<codeclass="descname">print_rgba</code><spanclass="sig-paren">(</span><em>self</em>, <em>filename_or_obj</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.print_rgba" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_to_buffer</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.print_to_buffer"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.print_to_buffer" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tostring_argb</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.tostring_argb"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.tostring_argb" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the image as an ARGB byte string.</p>
<p><aclass="reference internal" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.draw" title="matplotlib.backends.backend_agg.FigureCanvasAgg.draw"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">draw</span></code></a> must be called at least once before this function will work and
to update the renderer for any subsequent changes to the Figure.</p>
<codeclass="descname">tostring_rgb</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#FigureCanvasAgg.tostring_rgb"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.tostring_rgb" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the image as an RGB byte string.</p>
<p><aclass="reference internal" href="#matplotlib.backends.backend_agg.FigureCanvasAgg.draw" title="matplotlib.backends.backend_agg.FigureCanvasAgg.draw"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">draw</span></code></a> must be called at least once before this function will work and
to update the renderer for any subsequent changes to the Figure.</p>
<codeclass="descname">buffer_rgba</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.buffer_rgba"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.buffer_rgba" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">clear</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.clear"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.clear" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em>self</em>, <em>gc</em>, <em>path</em>, <em>transform</em>, <em>rgbFace=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.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>
<dt><strong>angle</strong><spanclass="classifier">float</span></dt><dd><p>The rotation angle in degrees anti-clockwise.</p>
</dd>
<dt><strong>mtext</strong><spanclass="classifier"><aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.text.Text</span></code></a></span></dt><dd><p>The original text object to be rendered.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p><strong>Note for backend implementers:</strong></p>
<p>When you are trying to determine if you have gotten your bounding box
right (which is what enables the text layout/alignment to work
properly), it helps to change the line in text.py:</p>
<codeclass="descname">get_canvas_width_height</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.get_canvas_width_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.get_canvas_width_height" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the canvas width and height in display coords.</p>
<codeclass="descname">option_image_nocomposite</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.option_image_nocomposite"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.option_image_nocomposite" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether image composition by Matplotlib should be skipped.</p>
<p>Raster backends should usually return False (letting the C-level
rasterizer take care of image composition); vector backends should
usually return <codeclass="docutils literal notranslate"><spanclass="pre">not</span><spanclass="pre">rcParams["image.composite_image"]</span></code>.</p>
<codeclass="descname">option_scale_image</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.option_scale_image"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.option_scale_image" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">points_to_pixels</code><spanclass="sig-paren">(</span><em>self</em>, <em>points</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.points_to_pixels"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.points_to_pixels" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert points to display units.</p>
<p>You need to override this function (unless your backend
doesn't have a dpi, e.g., postscript or svg). Some imaging
systems assume some value for pixels per inch:</p>
<codeclass="descname">start_filter</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.start_filter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.start_filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Start filtering. It simply create a new canvas (the old one is saved).</p>
<codeclass="descname">stop_filter</code><spanclass="sig-paren">(</span><em>self</em>, <em>post_processing</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.stop_filter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.stop_filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the plot in the current canvas as a image and apply
<codeclass="descname">tostring_argb</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.tostring_argb"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.tostring_argb" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tostring_rgb</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.tostring_rgb"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.tostring_rgb" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tostring_rgba_minimized</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#RendererAgg.tostring_rgba_minimized"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.RendererAgg.tostring_rgba_minimized" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_agg.</code><codeclass="descname">get_hinting_flag</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_agg.html#get_hinting_flag"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_agg.get_hinting_flag" title="Permalink to this definition">¶</a></dt>