Update: I am working on a little app that makes it convenient to use
twopi tools that come with GraphViz.
There is the popular GraphViz library and associated tools for generating graphs in a lot of environments. However, to have a little bit of fun, we can start with some code provided by Aaron Hillegass on his Big Nerd Ranch weblog(scroll down to the bottom). I think the main purpose of his code is actually not to explain how to draw graphs but to demonstrate some of the nice features of PyObjC.
Tip: You should actually create a fresh Xcode project based on Aaron’s source code if you don’t want to mess with PyObjC.