Dynamically Generating a Graph in Python

Istvan Albert ialbert at mailblocks.com
Thu Sep 30 10:34:42 EDT 2004


Tim Henderson wrote:

> I want to dynamically generate a graph in python that would be
> displayable on a web page. What would be the best way to do this?

See if you can run graphviz in the background.

http://www.research.att.com/sw/tools/graphviz/

If yes you'll need to create an input file
based on your data then run the dot utility
on it to generate a graphics file.

There is pydot module that generates graphviz
files:

http://dkbza.org/pydot.html

IMO is a little bit too complicated, and might not be worth the trouble.

The dot file format is fairly simple and you might be better off
just understanding it and then generating directly
in that format. You will need to understand the format
anyhow if you want to customize the output.

Istvan.



More information about the Python-list mailing list