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!
For NetworkX, a graph with more than 100K nodes may be too large. I'll demonstrate that it can handle a network with 187K nodes in this post, but the centrality calculations were prolonged. Luckily, there are some other packages available to help us with even larger graphs.
Due to its dependence on a pure-Python "dictionary of dictionary" data structure, NetworkX is a reasonably efficient, very scalable, highly portable framework for network and social network analysis.
NetworkX is the only library that is written in pure Python, so it is considerably slower than the rest.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With