Hi,

> I calculated communities on my graph with two different algorithms. To
> compare them visually I want to plot the graph with a specific layout, i.e.
> in my case fruchterman–reingold and color the vertices according to the
> first community structure.
> Then I want to change all colors to the second community structure, but
> preserve the position of all vertices.
> [...]
> Is one of these ideas doable with iGraph?

Yes - the plot() function has a layout=... argument that accepts an
arbitrary graph layout or the name of a layout algorithm. You can
simply create a layout first, store it in a variable, and then pass it
twice to plot():

my_layout = g.layout("fr")
cl1 = g.community_fastgreedy().as_clustering()
cl2 = g.community_walktrap().as_clustering()
plot(cl1, layout=my_layout)
plot(cl2, layout=my_layout)

T.

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to