Skip to content

save the layout using igraph

2 messages · kevinchang, Gábor Csárdi

#
Hi R users,

I am using built-in functions in  igraph package to draw networks . I need
to compare several network with exactly the same structure but with edge
hightlighted differently.  I am wondering if there is a way to save the
layout so that every graph will look the same as each other except for the
colors of edges. Or is there any parameter I can set for this purpose??

Thanks in advance, 
Shukai
#
Shukai,

the layout functions return a matrix that you can supply as the
'layout' argument of the plotting functions, e.g.

g1 <- erdos.renyi.game(50,2/50)
lay <- layout.fruchterman.reingold(g1)
g2 <- delete.edges(g1, sample(ecount(g1), 30)-1)
plot(g1, layout=lay, vertex.size=10)
plot(g2, layout=lay, vertex.size=10)

Best,
Gabor
On Tue, Mar 3, 2009 at 8:37 PM, kevinchang <shukai at seas.upenn.edu> wrote: