import matplotlib.pyplot as plt
import networkx as nx
G = nx.star_graph(20)
pos = nx.spring_layout(G)
colors = range(20)
edge_color边的颜色
nx.draw(G, pos, node_color='#A0CBE5', edge_color=colors,
width=4, edge_cmap=plt.cm.jet_r, with_labels=True)
plt.show()
nx.draw(G, pos, node_color='#A0CBE5', edge_color=colors,
width=4, edge_cmap=plt.cm.BuPu, with_labels=True)
nx.draw(G, pos, node_color='#A0CBE5', edge_color=colors,
width=4, edge_cmap=plt.cm.BuPu, with_labels=False)
nx.draw(G, pos, node_color=‘#A0CBE5’, edge_color=colors,width=4, edge_cmap=plt.cm.jet, with_labels=False)
edge_color边的颜色
nx.draw(G, pos, node_color=‘#A0CBE5’, edge_color=colors,
width=4, edge_cmap=plt.cm.winter, with_labels=False)
edge_color边的颜色
nx.draw(G, pos, node_color=‘#A0CBE5’, edge_color=colors,
width=4, edge_cmap=plt.cm.winter, with_labels=True)
edge_color边的颜色
nx.draw(G, pos, node_color=‘#A0CBE5’, edge_color=colors,
width=4, edge_cmap=plt.cm.winter_r, with_labels=True)
edge_color边的颜色
nx.draw(G, pos, node_color=‘#A0CBE5’, edge_color=colors,
width=4, edge_cmap=plt.cm.winter_r, with_labels=False