plot_simple_path.py 252 B

1234567891011121314
  1. """
  2. ===========
  3. Simple Path
  4. ===========
  5. Draw a graph with matplotlib.
  6. """
  7. import matplotlib.pyplot as plt
  8. import networkx as nx
  9. G = nx.path_graph(8)
  10. pos = nx.spring_layout(G, seed=47) # Seed layout for reproducibility
  11. nx.draw(G, pos=pos)
  12. plt.show()