(self, fname=None)
Saves the plot.

        @param fname: the filename to save to. It is ignored if the surface
          of the plot is not an C{ImageSurface}.
Saves the plot.
Saves the plot .
def save(self, fname=None):
        """Saves the plot.

        @param fname: the filename to save to. It is ignored if the surface
          of the plot is not an C{ImageSurface}.
        """
        if self._is_dirty:
            self.redraw()
        if isinstance(self._surface, cairo.ImageSurface):
            if fname is None and self._need_tmpfile:
                with named_temporary_file(prefix="igraph", suffix=".png") as fname:
                    self._surface.write_to_png(fname)
                    return None

            fname = fname or self._filename
            if fname is None:
                raise ValueError(
                    "no file name is known for the surface " + "and none given"
                )
            return self._surface.write_to_png(fname)

        if fname is not None:
            warn("filename is ignored for surfaces other than ImageSurface")

        self._ctx.show_page()
        self._surface.finish()
def save ( self , fname = None ) : if self . _is_dirty : self . redraw ( ) if isinstance ( self . _surface , cairo . ImageSurface ) : if fname is None and self . _need_tmpfile : with named_temporary_file ( prefix = "igraph" , suffix = ".png" ) as fname : self . _surface . write_to_png ( fname ) return None fname = fname or self . _filename if fname is None : raise ValueError ( "no file name is known for the surface " + "and none given" ) return self . _surface . write_to_png ( fname ) if fname is not None : warn ( "filename is ignored for surfaces other than ImageSurface" ) self . _ctx . show_page ( ) self . _surface . finish ( )