import matplotlib.pyplot as plt
import networkx as nx
H = nx.path_graph(10)
G.add_nodes_from(H)
nx.draw...=True)
plt.show()
G=nx.Graph()
G.add_edges_from([(1,2),(1,3),(2,4),(2,5),(3,6),(4,8),(5,8),(3,7)])
nx.draw...MultiGraph, MultiDiGraph, etc
nx.add_cycle(G, [0, 1, 2, 3])
nx.add_cycle(G, [10, 11, 12], weight=7)
nx.draw...5):
for j in range(i):
if (abs(i-j) not in (1,4)):
G.add_edge(i+1, j+1)
nx.draw...nx
G = nx.star_graph(20)
pos = nx.spring_layout(G)
colors = range(20)
nx.draw(G, pos, node_color='#