I have a graph from which I extract communities using Louvain-Algorithm implementation:
clusters = g.community_multilevel( weights=None, return_levels=False)
I then apply different colouring for each community:
new_cmap = ['#'+''.join([random.choice('0123456789abcdef') for x in range(6)]) for z in range(len(clusters))]
colors = {v: new_cmap[i] for i, c in enumerate(clusters) for v in c}
g.vs["color"] = [colors[e] for e in g.vs.indices]
Finally I plot the graph:
visual_style["layout"] = g.layout_fruchterman_reingold(weights=g.es["weight"], maxiter=1000, area=N ** 3, repulserad=N ** 3)
igraph.plot(g, **visual_style)
My question is :
Instead of this mixed-up graph, is there a way using a specific Layout, to plot every of the four community grouped by itself? I would like to separate every community in a different area of the graph increasing the visibility of their inner structure as well as the few edges with higher betweenness-centrality connecting the communities?
I have used the
contract-vertices
function that helped me to visualise, but is an oversimplification that just group every community in a single point and doesn't allow to visualise the inner structure of each community. Am I using 'contract-vertices' in the best way?
Thanks.