networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParameters
display_pygraphviz(graph, path, format=None, prog=None, args='')

Notes

If this function is called in succession too quickly, sometimes the image is not displayed. So you might consider time.sleep(.5) between calls if you experience problems.

Parameters

graph : PyGraphviz graph

A PyGraphviz AGraph instance.

path : file object

An already opened file object that will be closed.

format : str, None

An attempt is made to guess the output format based on the extension of the filename. If that fails, the value of format is used.

prog : string

Name of Graphviz layout program.

args : str

Additional arguments to pass to the Graphviz layout program.

Internal function to display a graph in OS dependent manner.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/drawing/nx_agraph.py#448
type: <class 'function'>
Commit: