Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c366341e2f061785e55a7fdd3b0a42d2 > files > 1025

python3-networkx-1.8.1-3.mga4.noarch.rpm

#!/usr/bin/env python
"""
Draw a graph with matplotlib.
You must have matplotlib for this to work.
"""
try:
    import matplotlib.pyplot as plt
except:
    raise 
    
import networkx as nx

G=nx.path_graph(8)
nx.draw(G)
plt.savefig("simple_path.png") # save as png
plt.show() # display