import networkx as nx
import matplotlib.pyplot as plt
Graph = nx.petersen_graph()
nx.draw_shell(Graph, nlist=[range(5, 10), range(5)], font_weight='bold',node_color=range(10),cmap=plt.cm.Blues,font_color='r',style='dotted')
plt.show()
运行结果:
import networkx as nx
import matplotlib.pyplot as plt
Graph = nx.petersen_graph()
nx.draw_shell(Graph, nlist=[range(5, 10), range(5)], font_weight='bold',node_color=range(10),cmap=plt.cm.Blues,font_color='r',style='dotted')
plt.show()
运行结果: