Playing around with cairo


As some of you might know I'm sometimes like to play around with some statistics. Nothing really fancy or too complicated. Just collecting, a bit of calculating and making pretty graphs. To make those graphs I have previously rrdtool, gnuplot as well as matplotlib. All of them have some merits and shortfalls, but in my opinion none of them make really fancy eyecandy.

I was most recently using matplotlib, but discovered that it had troubles when more then one graph was generated at one time. It managed to mix up the data of both graphs which led to incorrect and very ugly graphs. So I though I might as well go look for yet another alternative.

In researching for a potential solution to some of the matplotlib problems I ran into I had a look at the render backends used by matplotlib. One of them was cairo. This inspired my to just make the 2d graphs myself. The first plot was a bit boring, but the pie chart I'm making are pretty nice. I followed (visually) the example mentioned on visophyte (which in turn follows an example on

The higher pie chart below shows the amount of players in every house in the Ankh-Morpork Assassins' Guild on the Discworld mud. I only counted players who were online in the last 2 1/2 month. The lower pie chart shows how much time all those players spend on the disc during that time in relation to each house. (for correct interpretation please note that the colours for the houses aren't the same in both charts)





Posted by Freark


oehh, pretty!

Posted by someone claiming to be Pesto, 22 February 2008 @ 0:08