<aclass="reference internal" href="#matplotlib.backends.backend_template.RendererTemplate.draw_image" title="matplotlib.backends.backend_template.RendererTemplate.draw_image"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">draw_image</span></code></a>, etc.) and slowly see your figure come to life
instead having to have a full blown implementation before getting any results.</p>
<p>Copy this file to a directory outside of the Matplotlib source tree, somewhere
where Python can import it (by adding the directory to your <codeclass="docutils literal notranslate"><spanclass="pre">sys.path</span></code> or by
packaging it as a normal Python package); if the backend is importable as
<codeclass="docutils literal notranslate"><spanclass="pre">import</span><spanclass="pre">my.backend</span></code> you can then select it using</p>
<p>If your backend implements support for saving figures (i.e. has a <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">print_xyz</span></code>
method), you can register it as the default handler for a given file type:</p>
<codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">FigureCanvas</code><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureCanvas" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">FigureCanvasTemplate</code><spanclass="sig-paren">(</span><em><spanclass="n">figure</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#FigureCanvasTemplate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureCanvasTemplate" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#FigureCanvasTemplate.draw"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureCanvasTemplate.draw" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_default_filetype</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#FigureCanvasTemplate.get_default_filetype"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureCanvasTemplate.get_default_filetype" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the default savefig file format as specified in
<codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">FigureManager</code><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureManager" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">FigureManagerTemplate</code><spanclass="sig-paren">(</span><em><spanclass="n">canvas</span></em>, <em><spanclass="n">num</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#FigureManagerTemplate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.FigureManagerTemplate" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">GraphicsContextTemplate</code><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#GraphicsContextTemplate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.GraphicsContextTemplate" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">RendererTemplate</code><spanclass="sig-paren">(</span><em><spanclass="n">dpi</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate" title="Permalink to this definition">¶</a></dt>
<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 (i.e., an <aclass="reference internal" href="transformations.html#matplotlib.transforms.Affine2DBase" title="matplotlib.transforms.Affine2DBase"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Affine2DBase</span></code></a>) <em>may</em> be passed to
<aclass="reference internal" href="#matplotlib.backends.backend_template.RendererTemplate.draw_image" title="matplotlib.backends.backend_template.RendererTemplate.draw_image"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_image()</span></code></a>. 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
<codeclass="descname">draw_path</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">path</span></em>, <em><spanclass="n">transform</span></em>, <em><spanclass="n">rgbFace</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate.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">flipy</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate.flipy"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate.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><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate.get_canvas_width_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate.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">new_gc</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate.new_gc"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate.new_gc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an instance of a <aclass="reference internal" href="backend_bases_api.html#matplotlib.backend_bases.GraphicsContextBase" title="matplotlib.backend_bases.GraphicsContextBase"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">GraphicsContextBase</span></code></a>.</p>
<codeclass="descname">points_to_pixels</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">points</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#RendererTemplate.points_to_pixels"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.RendererTemplate.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="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">draw_if_interactive</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#draw_if_interactive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.draw_if_interactive" title="Permalink to this definition">¶</a></dt>
<dd><p>For image backends - is not required.
For GUI backends - this should be overridden if drawing should be done in
<codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">new_figure_manager_given_figure</code><spanclass="sig-paren">(</span><em><spanclass="n">num</span></em>, <em><spanclass="n">figure</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#new_figure_manager_given_figure"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.new_figure_manager_given_figure" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new figure manager instance for the given figure.</p>
<codeclass="descclassname">matplotlib.backends.backend_template.</code><codeclass="descname">show</code><spanclass="sig-paren">(</span><em><spanclass="o">*</span></em>, <em><spanclass="n">block</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_template.html#show"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_template.show" title="Permalink to this definition">¶</a></dt>
<dd><p>For image backends - is not required.
For GUI backends - show() is usually the last line of a pyplot script and
tells the backend that it is time to draw. In interactive mode, this