2021-01-31
作者:互联网
from matplotlib import pyplot as plt
import networkx as nx
G=nx.Graph()
G.add_nodes_from([1,2,3])
G.add_edges_from([(1,2),(1,3)])
nx.draw_networkx(G)
plt.show()
from matplotlib import pyplot as plt
import networkx as nx
G=nx.Graph()
G.add_nodes_from([1,2,3])
G.add_edges_from([(1,2),(1,3)])
G.add_edges_from([(2,3),(1,2)])
nx.draw_networkx(G)
plt.show()
CSDN搜索:Python Networkx基础知识及使用总结
标签:01,31,edges,nx,add,plt,2021,networkx,import 来源: https://blog.csdn.net/m0_38127487/article/details/113452482