igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Determining exact coordinates for a drawn graph in Python


From: Tamas Nepusz
Subject: Re: [igraph] Determining exact coordinates for a drawn graph in Python
Date: Fri, 25 Jun 2010 12:34:23 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Alex,

> Thanks for your help. What you said makes sense, but I think I have bigger
> problems than this. One of my specified coordinates is (0.006, 0.006), but
> the resulting picture does not place any point within 10 pixels of any of
> the image corners (where 20 is the max vertex size). Is there anything else
> that the plotter does to the coordinates when plotting them out?

I checked your graph and layout and it seems that you have more points
in the layout than in the graph. Your graph has 115 vertices, the layout
contains coordinates for 117 vertices (which is fine for igraph, it
simply uses the first 115), and incidentally, the point you mentioned
with coordinates (0.006, 0.006) is the 116th in the layout:

>>> graph.vcount()
115
>>> len(layout)
117
>>> layout[115]
[0.00608, 0.00608]

No wonder that there's no corresponding vertex in the layout.

> Also, my version of igraph doesn't seem to support the exact syntax
> you gave, but I've been using: plot(G, bbox=(0, 0, width, height)).
My bad, I've been using the development tree of igraph for too long ;)

By the way, how did you pickle the graph and the layout and what OS are
you using? The reason why I am asking is that I got an exception saying
"No such module igraph" when I tried to unpickle the graph and the
layout, and it took me a while until I realized that the module name in
your pickled files was in fact "igraph\r" (with a carriage return
character in the end) and not simply "igraph". I had to pipe the pickle
files through dos2unix to make it work.

-- 
Tamas



reply via email to

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