Answers for "plot graph networkx"

1

networkx display graph

import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_edge(1,2)
G.add_edge(1,3)
nx.draw(G, with_labels=True)
plt.show()
Posted by: Guest on April-07-2021

Browse Popular Code Answers by Language