Python graph drawing programΒΆ

Tags: python

Ero Carrera wrote a python wrapper for the GrapViz library: pydot.

Graphviz just finished compiling and it all works quite handy from python. This picture is generated from the following python code:

 import pydot
 g = pydot.Dot()
 g.add_edge(pydot.Edge('Reinout','Annie'))
 g.add_edge(pydot.Edge('Reinout','Maurits'))
 g.add_edge(pydot.Edge('Reinout','Herman'))
 g.add_edge(pydot.Edge('Reinout','Alie'))
 g.add_edge(pydot.Edge('Herman','Alie'))
 g.add_edge(pydot.Edge('Reinout','Rianne'))
 g.add_edge(pydot.Edge('Annie','Rianne'))
 g.write_jpeg('test.jpg')

That's not too bad!

(Found on the daily python URL!)