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: Alexander Tsiatas
Subject: Re: [igraph] Determining exact coordinates for a drawn graph in Python
Date: Fri, 25 Jun 2010 16:29:34 -0400

Hi Tamas,

Thanks for your time and help here. I'm just going to ignore those two vertices for the time being. I think there might still be something fishy going on, but it's not important enough for me right now. Eventually I looked at my plot and my coordinates and attempted to match them one-to-one. Doing this revealed a pattern for the coordinate transformation, and I actually had the right number of points for the coordinates. However, two of the points did not match up with my coordinates, indicating that maybe they matched up with the (0.006, 0.006) points.

I pickled the objects using dump(obj, f) where f is an open file object. I'm on a Windows box (:\) so that's probably why you had some trouble.

-Alex

On Fri, Jun 25, 2010 at 7:34 AM, Tamas Nepusz <address@hidden> wrote:
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

_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

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