Utilities for drawing Neet objects and graph representations.
view_pygraphviz(G, edgelabel=None, prog='dot', args='', suffix='', path=None, display_image=True)¶
Views the graph G using the specified layout algorithm.
This is a modified version of
networkx.drawing.nx_agraphto allow display toggle.
Copyright (C) 2004-2019 by Aric Hagberg <firstname.lastname@example.org> Dan Schult <email@example.com> Pieter Swart <firstname.lastname@example.org> All rights reserved. BSD license. Author: Aric Hagberg (email@example.com)
- G (networkx.Graph or networkx.DiGraph) – the graph to draw
- edgelabel (str, callable or None) – If a string, then it specifes the edge attribute to be displayed on the edge labels. If a callable, then it is called for each edge and it should return the string to be displayed on the edges. The function signature of edgelabel should be edgelabel(data), where data is the edge attribute dictionary.
- prog (str) – Name of Graphviz layout program.
- args (str) – Additional arguments to pass to the Graphviz layout program.
- suffix (str) – If filename is None, we save to a temporary file. The value of suffix will appear at the tail end of the temporary filename.
- path (str or None) – The filename used to save the image. If None, save to a temporary file. File formats are the same as those from pygraphviz.agraph.draw.
the filename of the generated image, and a
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.