I use iGraph in combination with python.
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.
Alternatively I could draw the graph, color my vertices according to the first community structure and give each vertex a color-coat according to the second one.
Is one of these ideas doable with iGraph?
Set seed for the same value for two plots. The algorithm is random, but after setting seed for the same value, it will output the same result two times. I tried it with R and igraph and it works, so I believe it works also for Python.
It will be something like that:
random.seed(123)
plot1
random.seed(123)
plot2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With