Draw network and grouped vertices of the same community or partition
I need view (drawn or plot) the communities structure in networks I have this: import igraph from random import randint def _plot(g, membership=None): layout = g.layout("kk") visual_style = {} visual_style["edge_color"] = "gray" visual_style["vertex_size"] = 30 visual_style["layout"] = layout visual_style["bbox"] = (1024, 768) visual_style["margin"] = 40 for vertex in g.vs(): vertex["label"] = vertex.index if membership is not None: colors = [] for i in range(0, max(membership)+1): colors.append('%06X' % randint(0, 0xFFFFFF)) for vertex in g.vs(): vertex["color"] = str('#') + colors[membership