Closed SimonEnsemble closed 2 years ago
You can give the location of nodes to gplot
as follows:
loc_x, loc_y = spring_layout(g)
gplot(g, loc_x=loc_x, loc_y=loc_y)
thanks. the above didn't work for me, but this does:
loc_x, loc_y = spring_layout(graph, 97330) # seed is 97330
gplot(graph, loc_x, loc_y)
I often need to redraw the same graph (via spring layout) multiple times but with different colors on the nodes.
an optimal argument
seed
to allow me to set the seed insidespring_layout
would be helpful so the layout doesn't change each time I re-rungplot
.currently, I must do: