How can I extract the colors of the individual vertices/communities from a community graph plot
?
E.g.
g = RandomGraph[{20, 40}];
CommunityGraphPlot[g]
I would like to plot each vertex number with its respective community-graph plot-color in another plot.
So far, I was able to get a list of the vertices in the respective communities with FindGraphCommunities[g]
. How can I continue from here?
Solution based on Szabolcs answer:
By employing
foundCommunities = FindGraphCommunities[g]
communityColors = GraphComputation`GraphInformationDump`$AutomaticColorList
Table[Thread[foundCommunities[[i]] -> communityColors[[i]]], {i, 1,Length@foundCommunities}]
I get
{1->Hue[0, 1, 0.8], 5->Hue[0, 1, 0.8], ...}, {10->Hue[0.14, 1, 0.9],...},...}
which I can use in a different plot.