Advertisement
furas

Python - networkx

May 12th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # screenshot: http://imgur.com/yHJ4J6V
  4.  
  5. # import modules (and assign shorter names)
  6. import networkx as nx
  7. import matplotlib.pyplot as plt
  8.  
  9. # create graph
  10. d = nx.DiGraph([(1,2), (1,3), (2,4), (4,3), (4,1)])
  11.  
  12. # create draw (in memory)
  13. nx.draw(d)
  14.  
  15. # display all
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement