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: Exit "raster" mode.  All of the drawing that was done since
  the last start_rasterizing command will be copied to the
  vector backend by calling draw_image.
  
  If stop_rasterizing is called multiple times before
  start_rasterizing is called, this method has no effect.
docstr_tok: ["Exit","``","raster","''","mode",".","All","of","the","drawing","that","was","done","since","the","last","start_rasterizing","command","will","be","copied","to","the","vector","backend","by","calling","draw_image",".","If","stop_rasterizing","is","called","multiple","times","before","start_rasterizing","is","called",",","this","method","has","no","effect","."]
code: def stop_rasterizing(self):
      """
      Exit "raster" mode.  All of the drawing that was done since
      the last start_rasterizing command will be copied to the
      vector backend by calling draw_image.
  
      If stop_rasterizing is called multiple times before
      start_rasterizing is called, this method has no effect.
      """
      self._rasterizing -= 1
      if self._rasterizing == 0:
          self._set_current_renderer(self._vector_renderer)
  
          height = self._height * self.dpi
          (
              buffer,
              bounds,
          ) = self._raster_renderer.tostring_rgba_minimized()
          l, b, w, h = bounds
          if w > 0 and h > 0:
              image = np.frombuffer(buffer, dtype=np.uint8)
              image = image.reshape((h, w, 4))
              image = image[::-1]
              gc = self._renderer.new_gc()
              # TODO: If the mixedmode resolution differs from the figure's
              #       dpi, the image must be scaled (dpi->_figdpi). Not all
              #       backends support this.
              self._renderer.draw_image(
                  gc,
                  l * self._figdpi / self.dpi,
                  (height - b - h) * self._figdpi / self.dpi,
                  image,
              )
          self._raster_renderer = None
          self._rasterizing = False
  
          # restore the figure dpi.
          self.figure.set_dpi(self._figdpi)
  
      if self._bbox_inches_restore:  # when tight bbox is used
          r = process_figure_for_rasterizing(
              self.figure, self._bbox_inches_restore, self._figdpi
          )
          self._bbox_inches_restore = r
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/backends/backend_mixed.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import numpy
  import six
  from matplotlib.backends.backend_agg import RendererAgg
  from matplotlib.tight_bbox import process_figure_for_rasterizing
label_desc: Use image node_id 4 for calling the MixedModeRenderer obj's underlying member method code with example usage: obj.stop_rasterizing() without return types