[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] grid graphs
From: |
Raphael C |
Subject: |
Re: [igraph] grid graphs |
Date: |
Tue, 12 Nov 2013 19:34:52 +0000 |
Thanks again.
Raphael
On 11 November 2013 21:45, Tamás Nepusz <address@hidden> wrote:
> Thank you. How can I then persuade igraph to plot the graph on a 2d
> grid maintaining the original position of the nodes?
>
>>>> layout = [index_to_grid_coords(i) for i in xrange(g.vcount())]
>>>> plot(g, layout=layout)
>
> Explanation: the layout=… keyword argument of plot() simply expects a Layout
> object or a list of (x, y) coordinates, one for each vertex in the graph. I
> simply construct such a list using the index_to_grid_coords() function and
> then pass that to plot() as the layout keyword.
>
> —
> T.
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>