Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > dfe2ee24432eb8a3bbaa8f735d9c6338 > files > 1271

python3-networkx-1.11-5.mga7.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