pydot_layout

pydot_layout(G, prog='neato', root=None, **kwds)[source]

Create node positions using pydot and Graphviz.

Parameters:
  • G (Graph) – NetworkX graph to be laid out.
  • prog (optional[str]) – Basename of the GraphViz command with which to layout this graph. Defaults to neato, the default GraphViz command for undirected graphs.
Returns:

Dictionary of positions keyed by node.

Return type:

dict

Examples

>>> G = nx.complete_graph(4)
>>> pos = nx.nx_pydot.pydot_layout(G)
>>> pos = nx.nx_pydot.pydot_layout(G, prog='dot')