'why networkx.draw() produces nothing? [duplicate]
I'm new to python and I'm using IPython, I'm starting to learn about NetworkX, but just in the starting point now I'm noticing that networkx.draw() is not working, here is my code:
import networkx as nx
g = nx.Graph()
g.add_nodes_from([1,2,3,4])
nx.draw(g)
but nothing is drawn!
Solution 1:[1]
I believe you could show this via PyPlot: http://matplotlib.org/api/pyplot_api.html
NetworkX has some great examples on their website: https://networkx.org/documentation/latest/auto_examples/index.html
A similar question and answer was posted here: Draw graph in NetworkX
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | zwep |