NetworkX

Previous topic

networkx.from_agraph

Next topic

networkx.write_dot

Quick search

networkx.to_agraph

to_agraph(N, graph_attr=None, node_attr=None, strict=True)

Return a pygraphviz graph from a NetworkX graph N.

If N is a Graph or DiGraph, graphviz attributes can be supplied through the arguments

graph_attr: dictionary with default attributes for graph, nodes, and edges
keyed by ‘graph’, ‘node’, and ‘edge’ to attribute dictionaries

node_attr: dictionary keyed by node to node attribute dictionary

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.