Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created April 5, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/c22573754a948324662a66f186fc163a to your computer and use it in GitHub Desktop.
Save prateekjoshi565/c22573754a948324662a66f186fc163a to your computer and use it in GitHub Desktop.
# plot the communities
color_map = []
for node in G:
if node in node_groups[0]:
color_map.append('blue')
else:
color_map.append('green')
nx.draw(G, node_color=color_map, with_labels=True)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment