[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] How to plot a lattice graph to look like a lattice?

**From**: |
Gábor Csárdi |

**Subject**: |
Re: [igraph] How to plot a lattice graph to look like a lattice? |

**Date**: |
Thu, 20 Oct 2011 08:55:26 -0400 |

Hi,
if you know which vertex goes where, then it is easy. E.g. for your
graph it is just:
plot(G, layout=as.matrix(expand.grid(1:5, 1:5)))
It is slightly more difficult if the vertex ids are not according to
the lattice placement.
Gabor
On Thu, Oct 20, 2011 at 8:46 AM, Prithwiraj MUKHERJEE
<address@hidden> wrote:
>* Hello*
>
>* I am sorry I cannot figure this out from the igraph documentation. I have a*
>* lattice graph:*
>
>* G<-graph.lattice(length=5,dim=2)*
>
>* I would like to plot it to look like a lattice. I see that it has been done*
>* in the igraph help page*
>* http://igraph.sourceforge.net/igraphbook/igraphbook-structures.html*
>
>* I would like my plot to look like the one in the above webpage, under the*
>* section "Lattices." Is it possible using igraph?*
>
>* Regards*
>* Prithwiraj*
>
>
>* _______________________________________________*
>* igraph-help mailing list*
>* address@hidden*
>* https://lists.nongnu.org/mailman/listinfo/igraph-help*
>
>
--
Gabor Csardi <address@hidden> MTA KFKI RMKI