How can I specify an exact output size for my networkx graph?

Viewed 66319

http://imgur.com/7wiRw.png

The above is the output of my current graph. However, I have yet to manage what I am trying to achieve. I need to output my graph in a larger size so that each node/edge can be viewed with ease.

I've tried nx.draw(G, node_size=size), but that only increases the size of the nodes, not the distance between nodes and edges.

3 Answers

you can increase the size of the plot as well as set the dpi. If dpi is lowered that nodes would spread out more.

G = nx.Graph()
# Add edges
fig = plt.figure(1, figsize=(200, 80), dpi=60)
nx.draw(G, with_labels=True, font_weight='normal')
Related