<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_svg_api.html">https://matplotlib.org/stable/api/backend_svg_api.html</a></div>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">FigureCanvas</code><aclass="headerlink" href="#matplotlib.backends.backend_svg.FigureCanvas" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">FigureCanvasSVG</code><spanclass="sig-paren">(</span><em>figure</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#FigureCanvasSVG"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.FigureCanvasSVG" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fixed_dpi</code><emclass="property"> = 72</em><aclass="headerlink" href="#matplotlib.backends.backend_svg.FigureCanvasSVG.fixed_dpi" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_default_filetype</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#FigureCanvasSVG.get_default_filetype"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.FigureCanvasSVG.get_default_filetype" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the default savefig file format as specified in rcParam
<codeclass="docutils literal notranslate"><spanclass="pre">savefig.format</span></code>. Returned string excludes period. Overridden
in backends that only support a single file type.</p>
<codeclass="descname">close_group</code><spanclass="sig-paren">(</span><em>self</em>, <em>s</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.close_group"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.close_group" title="Permalink to this definition">¶</a></dt>
<dd><p>Close a grouping element with label <em>s</em>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>points</strong><spanclass="classifier">array-like, shape=(N, 3, 2)</span></dt><dd><p>Array of <em>N</em> (x, y) points for the triangles.</p>
</dd>
<dt><strong>colors</strong><spanclass="classifier">array-like, shape=(N, 3, 4)</span></dt><dd><p>Array of <em>N</em> RGBA colors for each point of the triangles.</p>
</dd>
<dt><strong>transform</strong><spanclass="classifier"><aclass="reference internal" href="transformations.html#matplotlib.transforms.Transform" title="matplotlib.transforms.Transform"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.transforms.Transform</span></code></a></span></dt><dd><p>An affine transform to apply to the points.</p>
<dt><strong>x</strong><spanclass="classifier">scalar</span></dt><dd><p>The distance in physical units (i.e., dots or pixels) from the left
hand side of the canvas.</p>
</dd>
<dt><strong>y</strong><spanclass="classifier">scalar</span></dt><dd><p>The distance in physical units (i.e., dots or pixels) from the
bottom side of the canvas.</p>
</dd>
<dt><strong>im</strong><spanclass="classifier">array-like, shape=(N, M, 4), dtype=np.uint8</span></dt><dd><p>An array of RGBA pixels.</p>
</dd>
<dt><strong>transform</strong><spanclass="classifier"><aclass="reference internal" href="transformations.html#matplotlib.transforms.Affine2DBase" title="matplotlib.transforms.Affine2DBase"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.transforms.Affine2DBase</span></code></a></span></dt><dd><p>If and only if the concrete backend is written such that
transformation <em>may</em> be passed to <aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_image" title="matplotlib.backends.backend_svg.RendererSVG.draw_image"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_image()</span></code></a>. It takes the
form of a <aclass="reference internal" href="transformations.html#matplotlib.transforms.Affine2DBase" title="matplotlib.transforms.Affine2DBase"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Affine2DBase</span></code></a> instance.
The translation vector of the transformation is given in physical
units (i.e., dots or pixels). Note that the transformation does not
override <em>x</em> and <em>y</em>, and has to be applied <em>before</em> translating
the result by <em>x</em> and <em>y</em> (this can be accomplished by adding <em>x</em>
and <em>y</em> to the translation vector defined by <em>transform</em>).</p>
<codeclass="descname">draw_markers</code><spanclass="sig-paren">(</span><em>self</em>, <em>gc</em>, <em>marker_path</em>, <em>marker_trans</em>, <em>path</em>, <em>trans</em>, <em>rgbFace=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.draw_markers"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.draw_markers" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw a marker at each of the vertices in path.</p>
<p>This includes all vertices, including control points on curves.
To avoid that behavior, those vertices should be removed before
calling this function.</p>
<p>This provides a fallback implementation of draw_markers that
makes multiple calls to <aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_path" title="matplotlib.backends.backend_svg.RendererSVG.draw_path"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path()</span></code></a>. Some backends may
want to override this method in order to draw the marker only
<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_svg.html#RendererSVG.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.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>
<dd><p>Draw a collection of paths selecting drawing properties from
the lists <em>facecolors</em>, <em>edgecolors</em>, <em>linewidths</em>,
<em>linestyles</em> and <em>antialiaseds</em>. <em>offsets</em> is a list of
offsets to apply to each of the paths. The offsets in
<em>offsets</em> are first transformed by <em>offsetTrans</em> before being
applied. <em>offset_position</em> may be either "screen" or "data"
depending on the space that the offsets are in.</p>
<p>This provides a fallback implementation of
<aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_path_collection" title="matplotlib.backends.backend_svg.RendererSVG.draw_path_collection"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path_collection()</span></code></a> that makes multiple calls to
<aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_path" title="matplotlib.backends.backend_svg.RendererSVG.draw_path"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path()</span></code></a>. Some backends may want to override this in
order to render each set of path data only once, and then
reference that path multiple times with the different offsets,
colors, styles etc. The generator methods
<codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">_iter_collection_raw_paths()</span></code> and
<codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">_iter_collection()</span></code> are provided to help with (and
standardize) the implementation across backends. It is highly
recommended to use those generators, so that changes to the
behavior of <aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_path_collection" title="matplotlib.backends.backend_svg.RendererSVG.draw_path_collection"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path_collection()</span></code></a> can be made globally.</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">finalize</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.finalize"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.finalize" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">flipy</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.flipy"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.flipy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether y values increase from top to bottom.</p>
<p>Note that this only affects drawing of texts and images.</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_svg.html#RendererSVG.get_canvas_width_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.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">get_image_magnification</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.get_image_magnification"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.get_image_magnification" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the factor by which to magnify images passed to <aclass="reference internal" href="#matplotlib.backends.backend_svg.RendererSVG.draw_image" title="matplotlib.backends.backend_svg.RendererSVG.draw_image"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_image()</span></code></a>.
Allows a backend to have images at a different resolution to other
<codeclass="descname">open_group</code><spanclass="sig-paren">(</span><em>self</em>, <em>s</em>, <em>gid=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#RendererSVG.open_group"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.open_group" title="Permalink to this definition">¶</a></dt>
<dd><p>Open a grouping element with label <em>s</em> and <em>gid</em> (if set) as id.</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_svg.html#RendererSVG.option_image_nocomposite"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.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_svg.html#RendererSVG.option_scale_image"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.RendererSVG.option_scale_image" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">XMLWriter</code><spanclass="sig-paren">(</span><em>file</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">close</code><spanclass="sig-paren">(</span><em>self</em>, <em>id</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.close"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes open elements, up to (and including) the element identified
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>id</strong></dt><dd><p>Element identifier, as returned by the <aclass="reference internal" href="#matplotlib.backends.backend_svg.XMLWriter.start" title="matplotlib.backends.backend_svg.XMLWriter.start"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">start()</span></code></a> method.</p>
<codeclass="descname">comment</code><spanclass="sig-paren">(</span><em>self</em>, <em>comment</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.comment"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.comment" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">data</code><spanclass="sig-paren">(</span><em>self</em>, <em>text</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.data"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.data" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds character data to the output stream.</p>
<codeclass="descname">element</code><spanclass="sig-paren">(</span><em>self</em>, <em>tag</em>, <em>text=None</em>, <em>attrib={}</em>, <em>**extra</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.element"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.element" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds an entire element. This is the same as calling <aclass="reference internal" href="#matplotlib.backends.backend_svg.XMLWriter.start" title="matplotlib.backends.backend_svg.XMLWriter.start"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">start()</span></code></a>,
<aclass="reference internal" href="#matplotlib.backends.backend_svg.XMLWriter.data" title="matplotlib.backends.backend_svg.XMLWriter.data"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">data()</span></code></a>, and <aclass="reference internal" href="#matplotlib.backends.backend_svg.XMLWriter.end" title="matplotlib.backends.backend_svg.XMLWriter.end"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">end()</span></code></a> in sequence. The <em>text</em> argument can be
<codeclass="descname">end</code><spanclass="sig-paren">(</span><em>self</em>, <em>tag=None</em>, <em>indent=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.end"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.end" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes the current element (opened by the most recent call to
<codeclass="descname">flush</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.flush"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.flush" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">start</code><spanclass="sig-paren">(</span><em>self</em>, <em>tag</em>, <em>attrib={}</em>, <em>**extra</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#XMLWriter.start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.XMLWriter.start" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens a new element. Attributes can be given as keyword
arguments, or as a string/string dictionary. The method returns
an opaque identifier that can be passed to the <aclass="reference internal" href="#matplotlib.backends.backend_svg.XMLWriter.close" title="matplotlib.backends.backend_svg.XMLWriter.close"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">close()</span></code></a>
method, to close all open elements up to and including this one.</p>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">escape_attrib</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#escape_attrib"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.escape_attrib" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">escape_cdata</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#escape_cdata"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.escape_cdata" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">escape_comment</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#escape_comment"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.escape_comment" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">generate_css</code><spanclass="sig-paren">(</span><em>attrib={}</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#generate_css"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.generate_css" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">generate_transform</code><spanclass="sig-paren">(</span><em>transform_list=[]</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#generate_transform"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.generate_transform" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.backends.backend_svg.</code><codeclass="descname">short_float_fmt</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_svg.html#short_float_fmt"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_svg.short_float_fmt" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a short string representation of a float, which is %f
formatting with trailing zeros and the decimal point removed.</p>