DOT#

The DOT graph description language defines a file format that is most often used in the context of graph visualization with Graphviz. NetworkX provides an interface to Graphviz via pygraphviz, implemented in nx_agraph. If pygraphviz is installed, nx_agraph can be used to read and write files in DOT format.

NetworkX also provides an interface to Graphviz via pydot, implemented in nx_pydot. If pydot is installed, nx_pydot can be used to read and write files in DOT format.

pygraphviz#

read_dot(path)

Returns a NetworkX graph from a dot file on path.

write_dot(G, path)

Write NetworkX graph G to Graphviz dot format on path.

nx_pydot#

read_dot(path)

Returns a NetworkX MultiGraph or MultiDiGraph from the dot file with the passed path.

write_dot(G, path)

Write NetworkX graph G to Graphviz dot format on path.