[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Plot.show() on windows

From: Júlio de Lima do Rêgo Monteiro
Subject: Re: [igraph] Plot.show() on windows
Date: Fri, 25 Apr 2008 19:55:37 -0100
User-agent: Thunderbird (Windows/20080213)

Hi there Tamas,

Thanks for the quick reply!
After I applied the patch, fig.show() no longer generates an error, but also doesn't show any picture. Nothing happened. I realized it was because the imageviewer application was not being executed properly. So I changed the file configuration.py, changing the return value from the function get_platform_image_viewer()
from "start" to " " in case of the Windows platform.

49:    elif plat == "Windows":
50:        # Use the built-in Windows image viewer, if available
51:        return " "   <---- here
52:    else:

Ant this solved it for me!
Thanks a lot for the help!

Tamas Nepusz wrote:

If I change fig.show() to fig.save("test.png") it works.

Anyone has a clue on what could be the problem?
Well, the igraph plotting facility has not been tested too much on Windows ;) Since I mostly use OS X, I only tried it in a virtual machine before release and it worked there.

The only difference between fig.show() and fig.save(whatever) is that the former one tries to create a temporary file somewhere, start the Windows Picture and Fax Viewer to view it and then delete the temporary file. It looks like igraph either incorrectly detects the temporary directory where it tries to put the PNG file or you don't have writing permission to that directory. After having received the IOError, you might try printing fig._tmpfile_obj or fig._tmpfile_obj.name to figure out where did it try to save the picture.

On second thought, I remember having fixed a bug like this after the release of igraph 0.5. Since 0.5.1 has not been released yet, you might try modifying drawing.py in the igraph Python interface source by hand. The patch is here:


Lines that have to be removed are denoted by red, new lines that were added are blue.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]