So if G
is your graph, you can fit standard stochastic block model (ie the one without degree corrections) to obtain the community structure as:
state = gt.minimize_blockmodel_dl(G, deg_corr=False)
After this, you can use draw
method which is simply a wrapper to the graph_draw()
as:
state.draw(pos=g.vp.pos, output="my_graph.pdf")
Hope this helps.
vprop_int = g.new_vertex_property("int")
vprop[g1.vertex(0)] = 5
...
then you will get property for all vertice in your case, you might assign different number then when you are drawing
graph_draw(g, vertex_text=g.vertex_index, vertex_font_size=80
, vertex_fill_color=vprop_int
, edge_pen_width=20, edge_color=eprop_int
, output_size=(20000, 20000), output="test.png")
the part you decide the color of vertice i put
vertex_fill_color=vprop_int
I hope this will help
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.