def __init__(self, width, height, dpi, vector_renderer, raster_renderer_class=None):
if raster_renderer_class is None:<EOL><INDENT>raster_renderer_class = RendererAgg<EOL><DEDENT>self._raster_renderer_class = raster_renderer_class<EOL>self._width = width<EOL>self._height = height<EOL>self.dpi = dpi<EOL>assert not vector_renderer.option_image_nocomposite()<EOL>self._vector_renderer = vector_renderer<EOL>self._raster_renderer = None<EOL>self._rasterizing = <NUM_LIT:0><EOL>self._set_current_renderer(vector_renderer)<EOL>
width: The width of the canvas in logical units

height: The height of the canvas in logical units

dpi: The dpi of the canvas

vector_renderer: An instance of a subclass of RendererBase
that will be used for the vector drawing.

raster_renderer_class: The renderer class to use for the
raster drawing.  If not provided, this will use the Agg
backend (which is currently the only viable option anyway.)