Created
April 15, 2010 08:33
-
-
Save aeter/366843 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#draw a graph: | |
import pygraphviz as pgv | |
def graph_as_png(graph=graph): | |
G = pgv.AGraph() | |
for nodes in graph: | |
G.add_node(nodes) | |
for nodes in graph: | |
for ch_nodes in graph[nodes]: | |
G.add_edge(nodes, ch_nodes) | |
G.layout(prog='dot') | |
G.draw('graph-pic.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment