Saturday, April 18, 2009

Plotting graphs on the Mac

I am developing an iPhone pedometer application that uses the accelerometer to count paces. My tests generate a lot of data - 40 readings per seconds - that I wanted to visualise some how to allow me to develop an algorithm to count the paces. After a test run with my POC app I had a file with about 100,000 lines of float data.

I first tried Apples Numbers which is a part of iWork which chocked on the data and became impossibly slow to use. It also does not have many options regarding the presentation of the graph.

After a quick Google search I found gnuplot which can be installed using macports like this

: sudo port install gnuplot

However it would not start on my Leopard machine until I reinstalled X11 from here:

http://xquartz.macosforge.org/trac/wiki

after installing the latest X11 everything ran perfectly. It plotted my 100k points in a split second making Numbers look like the bloated eye candy that I have come to expect from iWork. The degree of flexibility is amazing and the ability to use standard unix file manipulation commands adds even more options. But I was a bit frustrated that I could not use transparency in the current version (4.2.4) and it was a pain in the ass to change the background colour; you need to set a command line property when you launch it.

Then I found Plot which seems to have a lot of the options that gnuplot has but all packaged up into a nice UI.

http://plot.micw.eu/

It was easy to change background colours and set transparency etc. I think this will be very useful in visualising my data points and creating some pretty graphs for documentation pages. It does not handle 3D graphs but that is not a problem for me.

The options in Plot are astounding - curve fitting, smoothing, many buttons that have complicated sounding names. It all makes me wonder why anyone would create such an elaborate program for free. Perhaps they make money from donations? Or perhaps they don't think about money quite as much as I do. Or maybe that is the reason that the last version was released over two years ago and has not reached 1.0 yet.

But good workMichael Wesemann of Berlin! The world is a slightly better place due to your free program.