class_docstr: A helper class to implement a renderer that switches between
  vector and raster drawing.  An example may be a PDF writer, where
  most things are drawn with PDF vector commands, but some very
  complex objects, such as quad meshes, are rasterised and then
  output as images.
docstr: Parameters
  ----------
  figure : `~matplotlib.figure.Figure`
      The figure instance.
  width : scalar
      The width of the canvas in logical units
  height : scalar
      The height of the canvas in logical units
  dpi : float
      The dpi of the canvas
  vector_renderer : `~matplotlib.backend_bases.RendererBase`
      An instance of a subclass of
      `~matplotlib.backend_bases.RendererBase` that will be used for the
      vector drawing.
  raster_renderer_class : `~matplotlib.backend_bases.RendererBase`
      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.)
code: def __init__(
      self,
      figure,
      width,
      height,
      dpi,
      vector_renderer,
      raster_renderer_class=None,
      bbox_inches_restore=None,
  ):
      """
      Parameters
      ----------
      figure : `~matplotlib.figure.Figure`
          The figure instance.
      width : scalar
          The width of the canvas in logical units
      height : scalar
          The height of the canvas in logical units
      dpi : float
          The dpi of the canvas
      vector_renderer : `~matplotlib.backend_bases.RendererBase`
          An instance of a subclass of
          `~matplotlib.backend_bases.RendererBase` that will be used for the
          vector drawing.
      raster_renderer_class : `~matplotlib.backend_bases.RendererBase`
          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.)
  
      """
      if raster_renderer_class is None:
          raster_renderer_class = RendererAgg
  
      self._raster_renderer_class = raster_renderer_class
      self._width = width
      self._height = height
      self.dpi = dpi
  
      self._vector_renderer = vector_renderer
  
      self._raster_renderer = None
  
      # A reference to the figure is needed as we need to change
      # the figure dpi before and after the rasterization. Although
      # this looks ugly, I couldn't find a better solution. -JJL
      self.figure = figure
      self._figdpi = figure.dpi
  
      self._bbox_inches_restore = bbox_inches_restore
  
      self._renderer = vector_renderer
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/backends/backend_mixed.py
imports: import numpy
  from matplotlib import cbook
  from .backend_agg import RendererAgg
  from matplotlib._tight_bbox import process_figure_for_rasterizing
label_desc: Use image node_id 1 to create a new MixedModeRenderer object  with example: obj = MixedModeRenderer(figure, width, height, dpi, vector_renderer, raster_renderer_class, bbox_inches_restore)