title: Preventing Overlap of edges and nodes with NetwrokX/Matplotlib
body: <p>I am trying to plot numbers of a problem "Collatz Conjecture" which forms a nice network between numbers(node labels). However, in the final plot of the solution using networkx <code>nx.spring_layout(G)</code> I get overlapping edges and nodes:
  <a href="https://i.stack.imgur.com/ZLREu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZLREu.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/djOuZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/djOuZ.png" alt="enter image description here"></a></p>
  
  <p>The nx.spring_layout is configured(through trial and error) as:</p>
  
  <pre><code> pos=nx.spring_layout(G,k = 0.004, iterations = 500, scale = 0.6)
   nx.draw(G, labels=labels, pos=pos, font_size = 6, alpha = 0.5, node_size = nodes.values())
   plt.show()
  </code></pre>
  
  <p>Is there a particular way to prevent this overlap, given that there is adequate empty space in the plotting window? Node size in this case is dictated by the value of:<code>len(G.neighbors(node))</code>
  No node has more that 3 neighbours and the max node size is capped at 300 to further prevent overlap.
  The odd thing is that for the longer branches this seems to be handled fairly well, but for branches such as [24,12,6,3,10] as in the images, it fails to demarcate this branch sufficiently, in other cases it overlaps altogether. Please advise if I should use another layout besides <code>nx.spring_layout(G)</code> which might handle this better.</p>