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!)

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):