matplotlib.backends.backend_mixed
#
- classmatplotlib.backends.backend_mixed.MixedModeRenderer(figure,width,height,dpi,vector_renderer,raster_renderer_class=None,bbox_inches_restore=None)[source]#
Bases:
object
A helper class to implement a renderer that switches betweenvector and raster drawing. An example may be a PDF writer, wheremost things are drawn with PDF vector commands, but some verycomplex objects, such as quad meshes, are rasterised and thenoutput as images.
- Parameters:
- figure
Figure
The figure instance.
- widthfloat
The width of the canvas in logical units
- heightfloat
The height of the canvas in logical units
- dpifloat
The dpi of the canvas
- vector_renderer
RendererBase
An instance of a subclass of
RendererBase
that will be used for thevector drawing.- raster_renderer_class
RendererBase
The renderer class to use for the raster drawing. If not provided,this will use the Agg backend (which is currently the only viableoption anyway.)
- figure
- start_rasterizing()[source]#
Enter "raster" mode. All subsequent drawing commands (until
stop_rasterizing
is called) will be drawn with the raster backend.
- stop_rasterizing()[source]#
Exit "raster" mode. All of the drawing that was done sincethe last
start_rasterizing
call will be copied to thevector backend by calling draw_image.