0

I have a Networkx / pyplot graph that graphs the network traffic. For some reason, all of the nodes are on top of each other: Pyplot Graph

Any idea what I can do to make this more legible? here is my code:

def draw_graph(ip_dict):

G = nx.Graph()

for key, value in ip_dict.items():
    G.add_edge(key[0],key[1], weight=value)
nx.draw_networkx(G)
plt.show()
JavaNoob
  • 23
  • 4
  • A large part of the problem is that the available canvas is used poorly as the components are far apart. The `spring` layout implementation in networkx does not handle disjunct components correctly, as I have written about [here](https://github.com/networkx/networkx/issues/4885). [Here](https://stackoverflow.com/a/53156709/2912349) are some suggestions to mitigate this problem. – Paul Brodersen Nov 21 '22 at 15:20

0 Answers0