#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

networkx.drawing.nx_agraph.to_agraph

to_agraph(N)[source]

Returns a pygraphviz graph from a NetworkX graph N.

Parameters

N (NetworkX graph) – A graph created with NetworkX

Examples

>>> K5 = nx.complete_graph(5)
>>> A = nx.nx_agraph.to_agraph(K5)

Notes

If N has an dict N.graph_attr an attempt will be made first to copy properties attached to the graph (see from_agraph) and then updated with the calling arguments if any.