Hey,
Is there a way to asign a specific colour to vertices, which are part of one community in CommunityGraphPlot.
CommunityGraphPlot[RandomGraph[{30, 300}, DirectedEdges -> True]]
Best,
Hey,
Is there a way to asign a specific colour to vertices, which are part of one community in CommunityGraphPlot.
CommunityGraphPlot[RandomGraph[{30, 300}, DirectedEdges -> True]]
Best,
Hi,
the problem is that CommunityGraphPlot does not appear to do that automatically. But you can change it a bit to make it work:
g = RandomGraph[{30, 300}]; color =
Table[RandomColor[], {i, 1,
Length[FindGraphCommunities[g]]}]; CommunityGraphPlot[g,
DirectedEdges -> True,
VertexStyle ->
Join[Flatten[
Table[# -> color[[i]] & /@ FindGraphCommunities[g][[i]], {i, 1,
Length[FindGraphCommunities[g]]}]], {5 -> Black}]]
In this case I colour 5th vertex in black.
I do admit that this is not very elegant…
Cheers,
M.