def pygraphviz_layout(G,prog='neato',root=None, args=''):
    try:
        import pygraphviz
    except ImportError:
        raise ImportError('requires pygraphviz ',
                          'http://networkx.lanl.gov/pygraphviz ',
                          '(not available for Python3)')
    if root is not None:
        args+="-Groot=%s"%root
    A=to_agraph(G)
    A.layout(prog=prog,args=args)
    node_pos={}
    for n in G:
        node=pygraphviz.Node(A,n)
        try:
            xx,yy=node.attr["pos"].split(',')
            node_pos[n]=(float(xx),float(yy))
        except:
            print("no position for node",n)
            node_pos[n]=(0.0,0.0)
    return node_pos
Create node positions for G using Graphviz.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/drawing/nx_agraph.py/pygraphviz_layout