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

Reinout van Rees

My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.

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