(self)
Saves the plot to a temporary file and shows it.

        This method is deprecated from igraph 0.9.1 and will be removed in
        version 0.10.0.

        @deprecated: Opening an image viewer with a temporary file never worked
            reliably across platforms.
Saves the plot to a temporary file and shows it.
Saves the plot to a temporary file and shows it .
def show(self):
        """Saves the plot to a temporary file and shows it.

        This method is deprecated from igraph 0.9.1 and will be removed in
        version 0.10.0.

        @deprecated: Opening an image viewer with a temporary file never worked
            reliably across platforms.
        """
        warn("Plot.show() is deprecated from igraph 0.9.1", DeprecationWarning)

        if not isinstance(self._surface, cairo.ImageSurface):
            sur = cairo.ImageSurface(
                cairo.FORMAT_ARGB32, int(self.bbox.width), int(self.bbox.height)
            )
            ctx = cairo.Context(sur)
            self.redraw(ctx)
        else:
            sur = self._surface
            ctx = self._ctx
            if self._is_dirty:
                self.redraw(ctx)

        with named_temporary_file(prefix="igraph", suffix=".png") as tmpfile:
            sur.write_to_png(tmpfile)
            config = Configuration.instance()
            imgviewer = config["apps.image_viewer"]
            if not imgviewer:
                # No image viewer was given and none was detected. This
                # should only happen on unknown platforms.
                plat = platform.system()
                raise NotImplementedError(
                    "showing plots is not implemented on this platform: %s" % plat
                )
            else:
                os.system("%s %s" % (imgviewer, tmpfile))
                if platform.system() == "Darwin" or self._windows_hacks:
                    # On Mac OS X and Windows, launched applications are likely to
                    # fork and give control back to Python immediately.
                    # Chances are that the temporary image file gets removed
                    # before the image viewer has a chance to open it, so
                    # we wait here a little bit. Yes, this is quite hackish :(
                    time.sleep(5)
def show ( self ) : warn ( "Plot.show() is deprecated from igraph 0.9.1" , DeprecationWarning ) if not isinstance ( self . _surface , cairo . ImageSurface ) : sur = cairo . ImageSurface ( cairo . FORMAT_ARGB32 , int ( self . bbox . width ) , int ( self . bbox . height ) ) ctx = cairo . Context ( sur ) self . redraw ( ctx ) else : sur = self . _surface ctx = self . _ctx if self . _is_dirty : self . redraw ( ctx ) with named_temporary_file ( prefix = "igraph" , suffix = ".png" ) as tmpfile : sur . write_to_png ( tmpfile ) config = Configuration . instance ( ) imgviewer = config [ "apps.image_viewer" ] if not imgviewer : # No image viewer was given and none was detected. This # should only happen on unknown platforms. plat = platform . system ( ) raise NotImplementedError ( "showing plots is not implemented on this platform: %s" % plat ) else : os . system ( "%s %s" % ( imgviewer , tmpfile ) ) if platform . system ( ) == "Darwin" or self . _windows_hacks : # On Mac OS X and Windows, launched applications are likely to # fork and give control back to Python immediately. # Chances are that the temporary image file gets removed # before the image viewer has a chance to open it, so # we wait here a little bit. Yes, this is quite hackish :( time . sleep ( 5 )