Skip to content

Graphication on OS X (with pycairo)

I’m working on some visualizations and I want to achieve the look of visualization lastgraph3:


The great thing about this is that Andew Godwin, author of the site open sourced the underlying library – Graphication.

Since I’m an OS X user, I decided to make the whole thing work on my system – Leopard 10.5.6 at the time of this writing. Here are the notes, mostly for my reference and because it might be also useful to others:

Get free XCode from Apple:

First build and install pkg-config from:

Then install libpng and libjpeg libraries:

Build and install pixman from:

Build and install cairo from:

Build and install pycairo from:

– you’ll need to edit cairo/ file by modifying parameter _cairo_la_LDFLAGS (around line 215) to remove ‘-export-symbols-regex init_cairo’
(thanks Michael Dales)

Build instructions:
– just follow INSTALL file. Essential running:
./configure –prefix=/System/Library/Frameworks/Python.framework/Versions/2.5 (sys.path for my system)
and then make && sudo make install

Now you can finally build and install Graphication package 🙂

All the installations steps are just ./configure && make && sudo make install and just work out of the box. I already have Python PIL installed from sources and I think you need this for one of the steps, but I’m not sure anymore for which one.

After you go through all the steps, you can start drawing something like that:

Simple visualization
Simple visualization

Now to figure out how to create something meaningful with it.

Reblog this post [with Zemanta]

One response to “Graphication on OS X (with pycairo)

Comments are closed.