title: How to get the length of lines representing edges in the plot of graph after layout out using networkx
body: <p>For a graph in networkx, I have made a layout to draw a network graph using code below:</p>
  <pre><code>data = pd.read_csv('data\\email-dept3.csv')
  edges = [edge for edge in zip(data['source'],data['target'])]
  print(len(edges))
  G = nx.Graph()
  G.add_edges_from(edges)
  
  node_pos = nx.kamada_kawai_layout(G)
  
  #I want to get the edge length as one attributes, but I don't know how to code this function
  edge_length = calculate_edge_length()
  
  nx.draw_networkx_nodes(G,node_pos,**options)#draw nodes
  [nx.draw_networkx_edges(G,node_pos,edgelist=[key],alpha=np.amin([1,value*100]),width=2) for key,value in cent.items()] 
  
  plt.show()
  </code></pre>
  <p>And the result is:</p>
  <p><a href="https://i.stack.imgur.com/HYifT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HYifT.png" alt="the shown network graph" /></a></p>
  <p><strong>What I want to do is get the every edge's length in this graph</strong>. Because after layout, every node has a position in screen, and the edge has its length according to its two nodes' position. But in networkx's API, I can't find the method to get the edge's length. And I also don't know how to calculate this value.</p>
  <p>If you need more information, please contact me.</p>