Skip to content

Instantly share code, notes, and snippets.

@reiddraper
Created March 7, 2010 20:58
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 reiddraper/324624 to your computer and use it in GitHub Desktop.
Save reiddraper/324624 to your computer and use it in GitHub Desktop.
import networkx as nx
G = nx.read_gpickle('lebanese.mp3.graph.gpickle')
# pos has the x, y coordinates of the nodes
pos = nx.spring_layout(G)
# you'll need to figure out how to draw the edges yourself though I think
# drawing
# simplest
nx.draw(G, pos)
# more control
nx.draw_networkx_nodes(G, pos, node_color = 'k', alpha = 0.15, node_size = 25)
nx.draw_networkx_edges(G, pos, alpha = 0.30, arrows = False, edge_color='b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment