class_docstr: Class representing an arbitrary plot that uses the Cairo plotting
  backend.
  
  Objects that you can plot include graphs, matrices, palettes, clusterings,
  covers, and dendrograms.
  
  In Cairo, every plot has an associated surface object. The surface is an
  instance of C{cairo.Surface}, a member of the C{pycairo} library. The
  surface itself provides a unified API to various plotting targets like SVG
  files, X11 windows, PostScript files, PNG files and so on. C{igraph} does
  not usually know on which surface it is plotting at each point in time,
  since C{pycairo} takes care of the actual drawing. Everything that's
  supported by C{pycairo} should be supported by this class as well.
  
  Current Cairo surfaces include:
  
    - C{cairo.GlitzSurface} -- OpenGL accelerated surface for the X11
      Window System.
  
    - C{cairo.ImageSurface} -- memory buffer surface. Can be written to a
      C{PNG} image file.
  
    - C{cairo.PDFSurface} -- PDF document surface.
  
    - C{cairo.PSSurface} -- PostScript document surface.
  
    - C{cairo.SVGSurface} -- SVG (Scalable Vector Graphics) document surface.
  
    - C{cairo.Win32Surface} -- Microsoft Windows screen rendering.
  
    - C{cairo.XlibSurface} -- X11 Window System screen rendering.
  
  If you create a C{Plot} object with a string given as the target surface,
  the string will be treated as a filename, and its extension will decide
  which surface class will be used. Please note that not all surfaces might
  be available, depending on your C{pycairo} installation.
  
  A C{Plot} has an assigned default palette (see L{igraph.drawing.colors.Palette})
  which is used for plotting objects.
  
  A C{Plot} object also has a list of objects to be plotted with their
  respective bounding boxes, palettes and opacities. Palettes assigned to an
  object override the default palette of the plot. Objects can be added by the
  L{Plot.add} method and removed by the L{Plot.remove} method.
class_docstr_tok: ["Class","representing","an","arbitrary","plot","that","uses","the","Cairo","plotting","backend",".","Objects","that","you","can","plot","include","graphs",",","matrices",",","palettes",",","clusterings",",","covers",",","and","dendrograms",".","In","Cairo",",","every","plot","has","an","associated","surface","object",".","The","surface","is","an","instance","of","C","{","cairo.Surface","}",",","a","member","of","the","C","{","pycairo","}","library",".","The","surface","itself","provides","a","unified","API","to","various","plotting","targets","like","SVG","files",",","X11","windows",",","PostScript","files",",","PNG","files","and","so","on",".","C","{","igraph","}","does","not","usually","know","on","which","surface","it","is","plotting","at","each","point","in","time",",","since","C","{","pycairo","}","takes","care","of","the","actual","drawing",".","Everything","that's","supported","by","C","{","pycairo","}","should","be","supported","by","this","class","as","well",".","Current","Cairo","surfaces","include",":","-","C","{","cairo.GlitzSurface","}","--","OpenGL","accelerated","surface","for","the","X11","Window","System",".","-","C","{","cairo.ImageSurface","}","--","memory","buffer","surface",".","Can","be","written","to","a","C","{","PNG","}","image","file",".","-","C","{","cairo.PDFSurface","}","--","PDF","document","surface",".","-","C","{","cairo.PSSurface","}","--","PostScript","document","surface",".","-","C","{","cairo.SVGSurface","}","--","SVG","(","Scalable","Vector","Graphics",")","document","surface",".","-","C","{","cairo.Win32Surface","}","--","Microsoft","Windows","screen","rendering",".","-","C","{","cairo.XlibSurface","}","--","X11","Window","System","screen","rendering",".","If","you","create","a","C","{","Plot","}","object","with","a","string","given","as","the","target","surface",",","the","string","will","be","treated","as","a","filename",",","and","its","extension","will","decide","which","surface","class","will","be","used",".","Please","note","that","not","all","surfaces","might","be","available",",","depending","on","your","C","{","pycairo","}","installation",".","A","C","{","Plot","}","has","an","assigned","default","palette","(","see","L","{","igraph.drawing.colors.Palette","}",")","which","is","used","for","plotting","objects",".","A","C","{","Plot","}","object","also","has","a","list","of","objects","to","be","plotted","with","their","respective","bounding","boxes",",","palettes","and","opacities",".","Palettes","assigned","to","an","object","override","the","default","palette","of","the","plot",".","Objects","can","be","added","by","the","L","{","Plot.add","}","method","and","removed","by","the","L","{","Plot.remove","}","method","."]
docstr: Redraws the plot
docstr_tok: ["Redraws","the","plot"]
code: def redraw(self, context=None):
      """Redraws the plot"""
      ctx = context or self._ctx
      if self._background is not None:
          ctx.set_source_rgba(*self._background)
          ctx.rectangle(0, 0, self.bbox.width, self.bbox.height)
          ctx.fill()
  
      for obj, bbox, palette, opacity, args, kwds in self._objects:
          if palette is None:
              palette = getattr(obj, "_default_palette", self._palette)
          plotter = getattr(obj, "__plot__", None)
          if plotter is None:
              warn(
                  "%s does not support plotting" % (obj,), stacklevel=1
              )
          else:
              if opacity < 1.0:
                  ctx.push_group()
              else:
                  ctx.save()
              plotter(
                  "cairo",
                  ctx,
                  bbox=bbox,
                  palette=palette,
                  *args,  # noqa: B026
                  **kwds,
              )
              if opacity < 1.0:
                  ctx.pop_group_to_source()
                  ctx.paint_with_alpha(opacity)
              else:
                  ctx.restore()
  
      self._is_dirty = False
  
imports: import os
  from io import BytesIO
  from warnings import warn
  from igraph.configuration import Configuration
  from igraph.drawing.cairo.utils import find_cairo
  from igraph.drawing.colors import Palette, palettes
  from igraph.drawing.utils import BoundingBox
  from igraph.utils import named_temporary_file
label_desc: Use image node_id 7 for calling the CairoPlot obj's underlying member method code with example usage: obj.redraw(context) without return types