<divid="unreleased-message"> You are reading an old version of the documentation (v3.0.2). 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>
<emclass="property">class </em><codeclass="descclassname">matplotlib.backends.backend_cairo.</code><codeclass="descname">ArrayWrapper</code><spanclass="sig-paren">(</span><em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#ArrayWrapper"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.ArrayWrapper" title="Permalink to this definition">¶</a></dt>
<p><spanclass="versionmodified">Deprecated since version 3.0: </span>The ArrayWrapper class was deprecated in Matplotlib 3.0 and will be removed in 3.2.</p>
</div>
<dlclass="docutils">
<dt>Thin wrapper around numpy ndarray to expose the interface</dt>
<dd>expected by cairocffi. Basically replicates the
<codeclass="descname">buffer_info</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#ArrayWrapper.buffer_info"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.ArrayWrapper.buffer_info" title="Permalink to this definition">¶</a></dt>
<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>figure</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">print_pdf</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_pdf"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_pdf" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_png</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</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_ps</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_ps"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_ps" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_raw</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</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>fobj</em>, <em>*args</em>, <em>**kwargs</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">print_svg</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_svg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_svg" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">print_svgz</code><spanclass="sig-paren">(</span><em>fobj</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#FigureCanvasCairo.print_svgz"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.print_svgz" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">supports_blit</code><emclass="property"> = False</em><aclass="headerlink" href="#matplotlib.backends.backend_cairo.FigureCanvasCairo.supports_blit" 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>renderer</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><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>returns a tuple of three or four floats from 0-1.</p>
<codeclass="descname">restore</code><spanclass="sig-paren">(</span><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>alpha</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.
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>cs</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 as a string in ('butt', 'round', 'projecting')</p>
<codeclass="descname">set_clip_path</code><spanclass="sig-paren">(</span><em>path</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>
<dd><p>Set the clip path and transformation. Path should be a
<codeclass="descname">set_clip_rectangle</code><spanclass="sig-paren">(</span><em>rectangle</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>offset</em>, <em>dashes</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>
<codeclass="descname">set_foreground</code><spanclass="sig-paren">(</span><em>fg</em>, <em>isRGBA=None</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>
<dd><p>Set the foreground color. fg can be a MATLAB format string, a
html hex color string, an rgb or rgba unit tuple, or a float between 0
and 1. In the latter case, grayscale is used.</p>
<p>If you know fg is rgba, set <codeclass="docutils literal notranslate"><spanclass="pre">isRGBA=True</span></code> for efficiency.</p>
<codeclass="descname">set_joinstyle</code><spanclass="sig-paren">(</span><em>js</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>w</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>dpi</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>
<emclass="property">static </em><codeclass="descname">convert_path</code><spanclass="sig-paren">(</span><em>ctx</em>, <em>path</em>, <em>transform</em>, <em>clip=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo.convert_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.convert_path" title="Permalink to this definition">¶</a></dt>
<dd><divclass="deprecated">
<p><spanclass="versionmodified">Deprecated since version 3.0: </span>The convert_path function was deprecated in Matplotlib 3.0 and will be removed in 3.2.</p>
transformation <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>. 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 <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">x</span></code> and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">y</span></code>, and has to be applied <em>before</em> translating
the result by <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">x</span></code> and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">y</span></code> (this can be accomplished by adding <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">x</span></code>
and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">y</span></code> to the translation vector defined by <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">transform</span></code>).</p>
<codeclass="descname">draw_markers</code><spanclass="sig-paren">(</span><em>gc</em>, <em>marker_path</em>, <em>marker_trans</em>, <em>path</em>, <em>transform</em>, <em>rgbFace=None</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>Draws a marker at each of the vertices in path. 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>gc</em>, <em>path</em>, <em>transform</em>, <em>rgbFace=None</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>Draws a <aclass="reference internal" href="path_api.html#matplotlib.path.Path" title="matplotlib.path.Path"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Path</span></code></a> instance using the
<codeclass="descname">draw_path_collection</code><spanclass="sig-paren">(</span><em>gc</em>, <em>master_transform</em>, <em>paths</em>, <em>all_transforms</em>, <em>offsets</em>, <em>offsetTrans</em>, <em>facecolors</em>, <em>edgecolors</em>, <em>linewidths</em>, <em>linestyles</em>, <em>antialiaseds</em>, <em>urls</em>, <em>offset_position</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo.draw_path_collection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.draw_path_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Draws 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_cairo.RendererCairo.draw_path_collection" title="matplotlib.backends.backend_cairo.RendererCairo.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_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 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_cairo.RendererCairo.draw_path_collection" title="matplotlib.backends.backend_cairo.RendererCairo.draw_path_collection"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">draw_path_collection()</span></code></a> can be made globally.</p>
<codeclass="descname">get_canvas_width_height</code><spanclass="sig-paren">(</span><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">get_text_width_height_descent</code><spanclass="sig-paren">(</span><em>s</em>, <em>prop</em>, <em>ismath</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/backends/backend_cairo.html#RendererCairo.get_text_width_height_descent"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.backends.backend_cairo.RendererCairo.get_text_width_height_descent" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the width, height, and descent (offset from the bottom
to the baseline), in display coords, of the string <em>s</em> with
<codeclass="descname">new_gc</code><spanclass="sig-paren">(</span><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 <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">GraphicsContextBase</span></code></p>
<codeclass="descname">points_to_pixels</code><spanclass="sig-paren">(</span><em>points</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>surface</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>width</em>, <em>height</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>