<divid="unreleased-message"> You are reading an old version of the documentation (v3.3.4). For the latest version see <ahref="https://matplotlib.org/stable/api/backend_cairo_api.html">https://matplotlib.org/stable/api/backend_cairo_api.html</a></div>
<codeclass="descclassname">matplotlib.backends.backend_cairo.</code><codeclass="descname">FigureCanvas</code><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvas" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_cairo.</code><codeclass="descname">FigureCanvasCairo</code><spanclass="sig-paren">(</span><em><spanclass="n">figure</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">copy_from_bbox</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">bbox</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.copy_from_bbox"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.copy_from_bbox" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_png</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">fobj</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_png"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_png" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_raw</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">fobj</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_raw" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_rgba</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">fobj</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_rgba"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_rgba" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">restore_region</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">region</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.restore_region"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.restore_region" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_cairo.</code><codeclass="descname">GraphicsContextCairo</code><spanclass="sig-paren">(</span><em><spanclass="n">renderer</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_rgb</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.get_rgb"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.get_rgb" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple of three or four floats from 0-1.</p>
<codeclass="descname">restore</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.restore"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.restore" title="Permalink to this definition">¶</a></dt>
<dd><p>Restore the graphics context from the stack - needed only
for backends that save graphics contexts on a stack.</p>
<codeclass="descname">set_alpha</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">alpha</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_alpha"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_alpha" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the alpha value used for blending - not supported on all backends.</p>
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">alpha=None</span></code> (the default), the alpha components of the
foreground and fill colors will be used to set their respective
transparencies (where applicable); otherwise, <codeclass="docutils literal notranslate"><spanclass="pre">alpha</span></code> will override
<codeclass="descname">set_capstyle</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">cs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_capstyle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_capstyle" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the capstyle to be one of ('butt', 'round', 'projecting').</p>
<codeclass="descname">set_clip_path</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">path</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_clip_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_clip_path" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_clip_rectangle</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">rectangle</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_clip_rectangle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_clip_rectangle" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the clip rectangle with sequence (left, bottom, width, height)</p>
<codeclass="descname">set_dashes</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">offset</span></em>, <em><spanclass="n">dashes</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_dashes"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_dashes" 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>dash_offset</strong><spanclass="classifier">float or None</span></dt><dd><p>The offset (usually 0).</p>
</dd>
<dt><strong>dash_list</strong><spanclass="classifier">array-like or None</span></dt><dd><p>The on-off sequence as points.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">(None,</span><spanclass="pre">None)</span></code> specifies a solid line.</p>
<p>See p. 107 of to PostScript <aclass="reference external" href="https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF">blue book</a> for more info.</p>
<codeclass="descname">set_foreground</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">fg</span></em>, <em><spanclass="n">isRGBA</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_foreground"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_foreground" title="Permalink to this definition">¶</a></dt>
<dt><strong>isRGBA</strong><spanclass="classifier">bool</span></dt><dd><p>If <em>fg</em> is known to be an <codeclass="docutils literal notranslate"><spanclass="pre">(r,</span><spanclass="pre">g,</span><spanclass="pre">b,</span><spanclass="pre">a)</span></code> tuple, <em>isRGBA</em> can be
<codeclass="descname">set_joinstyle</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">js</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_joinstyle"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_joinstyle" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the join style to be one of ('miter', 'round', 'bevel').</p>
<codeclass="descname">set_linewidth</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">w</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#GraphicsContextCairo.set_linewidth"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.GraphicsContextCairo.set_linewidth" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_cairo.</code><codeclass="descname">RendererCairo</code><spanclass="sig-paren">(</span><em><spanclass="n">dpi</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo" 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_cairo.RendererCairo.draw_image" title="matplotlib.backends.backend_cairo.RendererCairo.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_markers</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">gc</span></em>, <em><spanclass="n">marker_path</span></em>, <em><spanclass="n">marker_trans</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_cairo.html#RendererCairo.draw_markers"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.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_cairo.RendererCairo.draw_path" title="matplotlib.backends.backend_cairo.RendererCairo.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><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_cairo.html#RendererCairo.draw_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.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>
<emclass="property">property </em><codeclass="descname">fontangles</code><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.fontangles" title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="descname">fontweights</code><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.fontweights" title="Permalink to this definition">¶</a></dt>
<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_cairo.html#RendererCairo.get_canvas_width_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.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_cairo.html#RendererCairo.new_gc"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.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_cairo.html#RendererCairo.points_to_pixels"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.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">set_ctx_from_surface</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">surface</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo.set_ctx_from_surface"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.set_ctx_from_surface" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_width_height</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">width</span></em>, <em><spanclass="n">height</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo.set_width_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.set_width_height" title="Permalink to this definition">¶</a></dt>