title: Getting x,y positions of networkx draw_network object
body: <p>I need to generate synthetic network samples for a latent space model, instead of doing it by hand I figured I could use the networkX plot tool to generate the samples for me.</p>
  
  <pre><code>import networkx as nx
  a = nx.barabasi_albert_graph(10,2)
  nx.draw_networkx(a,with_labels=True,node_size=300)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7AYKq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7AYKq.png" alt="enter image description here"></a></p>
  
  <p>The positions of the nodes returned in an numpy array is exactly what I am looking for, are there any easy way to achieve this?</p>
  
  <p>e.g [(-0.24,-0.22),(-0.15,0.1),...,)] for point 1,2,...,n </p>