title: Python, pygraphviz, networkx
body: <p>I built a directed weighted graph using networkx and I can draw it, but it has very often crossed edges even if the graph is very small. I used pygraphviz also, but I was unable to add labels. Can someone help me with that ?</p>
  
  <pre><code>   edge_labels=dict([((u,v,),d['weight'])
                for u,v,d in DG.edges(data=True)])
     pylab.figure(1)
     pos=nx.spring_layout(DG)
  
     nx.draw(DG, pos)
     nx.draw_networkx_edge_labels(DG,pos,edge_labels=result,font_size=10)
  
     pylab.show()
  </code></pre>
  
  <p>How to convert it to pygraphviz graph and add labels to it</p>