title: Drawing graph in graphviz layout in python using nx.draw_graphviz gives error
body: <p>I am trying to draw a 100 node multi-graph G in graphviz layout in python's networkx so I made two trials so far:</p>
  
  <p><strong>Trial 1</strong> <a href="https://networkx.github.io/documentation/latest/reference/drawing.html" rel="nofollow">nx.draw_graphviz</a> function as follows <code>nx.draw_graphviz(G)</code> but I get the following error <strong>repeated for all nodes</strong> in the graph:</p>
  
  <blockquote>
    <p>Error: node 1, position [0.127506302389087, 0.3262608552621944], expected two doubles</p>
  </blockquote>
  
  <p>Then trying to figure a solution I used <strong>trial 2</strong> <code>A=nx.to_agraph(G)</code> to get a pygraphviz graph but when I try to draw with <code>nx.draw_graphviz(A)</code> I get the following Error:</p>
  
  <blockquote>
    <p>AttributeError: 'AGraph' object has no attribute 'number_of_selfloops'</p>
  </blockquote>
  
  <p><a href="https://networkx.github.io/documentation/latest/reference/generated/networkx.drawing.nx_agraph.graphviz_layout.html" rel="nofollow">nx.graphviz_layout</a> but it gives back a dictionary of positions keyed by nodes, and I do not know how to use it to draw the graphviz layout.</p>
  
  <p><strong>Note</strong> I imported graphviz, pygraphviz and pydot modules but I do not know which are the ones really needed for this, but it still does not work.</p>
  
  <p>Is there something missing there to draw the networkx graph in graphviz layout ?</p>
  
  <p>Full Trace of errors for</p>
  
  <p><strong>Trial 1</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 102, in &lt;module&gt;
      d.display_graph(sub_normal,NEUTRAL_RANGE)
    File "/home/abdallah/stage/Reputation_system/display.py", line 33, in display_graph
      nx.draw_graphviz(G)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pylab.py", line 982, in draw_graphviz
      pos = nx.drawing.graphviz_layout(G, prog)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pydot.py", line 257, in graphviz_layout
      return pydot_layout(G=G,prog=prog,root=root,**kwds)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pydot.py", line 277, in pydot_layout
      D=P.create_dot(prog=prog)
    File "/usr/lib/python2.7/dist-packages/pydot.py", line 1802, in &lt;lambda&gt;
      lambda f=frmt, prog=self.prog : self.create(format=f, prog=prog))
    File "/usr/lib/python2.7/dist-packages/pydot.py", line 2023, in create
      status, stderr_output) )
  pydot.InvocationException: Program terminated with status: 1. stderr follows: Error: node 0, position [0.7145101895899024, 0.9016482786797262], expected two doubles
  </code></pre>
  
  <p><strong>trial 2</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 102, in &lt;module&gt;
      d.display_graph(sub_normal,NEUTRAL_RANGE)
    File "/home/abdallah/stage/Reputation_system/display.py", line 33, in display_graph
      nx.draw_graphviz(A)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pylab.py", line 982, in draw_graphviz
      pos = nx.drawing.graphviz_layout(G, prog)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pydot.py", line 257, in graphviz_layout
      return pydot_layout(G=G,prog=prog,root=root,**kwds)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pydot.py", line 273, in pydot_layout
      P=to_pydot(G)
    File "/usr/local/lib/python2.7/dist-packages/networkx-1.10-py2.7.egg/networkx/drawing/nx_pydot.py", line 192, in to_pydot
      strict=N.number_of_selfloops()==0 and not N.is_multigraph()
  AttributeError: 'AGraph' object has no attribute 'number_of_selfloops'
  </code></pre>