Plotters Part III

October 10, 2010

Geek Week now resumes. Last week I started some burblings about plotting. Apologies for those who find this dull. Getting it off me chest.

Part I was a general intro. Part II was about mathematical environments, plot libraries, and equation graphers. Now I will launch into GUI based plotters.

There is a whole bunch of these, including things you pay for like Datagraph and ByeGraph, and some free things like Grace, Plot, SciDavis, and Hippodraw. Most but not all of these are multi-platform. They all have various strengths, but a common weakness – they are incredibly intimidating, with gazillions of windows, buttons, sliders, and options. It may well be that if you get used to one of these, they are just what you want; if that’s true for one my readers, let us know. But my own vote goes to two applications that I find much more intuitive and simple. What they have in common is that the complexity is hidden until you need it, which is made possible by the way they think of graphs as made up of a hierarchy of components, each of which can have its own settings – page, graph, x/y-axis, curve, dataset.

Mjograph. My first plug is for mjograph written by Makoto Tanahashi, a PhD student from Yokohama. Its a Java application, so it should work fine anywhere. It has a clean simple interface. It can plot multiple functions and multiple datafiles, listed as objects, so you can pick each one at a time and set its properties – point size, colour, line weight, etc. The adjustment of appearance, including annotation in TeX, is clean and simple but effective.  (I spotted one or two bugs though…) The approach to datafiles is also simple. It expects plain text files with x,y, and error columns in various allowed permutations. You just drag the file onto the window and it gets plotted. Weaknesses are that it doesn’t do parametric functions, and doesn’t do column manipulation (“plot column 3 as X, and the sum of columns 8 and 11 as y”) but really if you want that sort of thing you should probably use a scripting package like Gnuplot.

Veusz. The second plug is for Veusz written by Jeremy Sanders, a PDRA  at the Institute of Astronomy in Cambridge. This is written in Python, but is available wrapped up as a Windows, Mac or Linux app. Apparently VEUSZ is pronounced “Views” and stands for Velvet Ember Under Sky Zenith, for no particular reason. And why not. Veusz can do function plots, data files, and fits to data files. Like mjograph, it has a nice logical hierarchical approach to editing the properties of various objects, and its quite easy to adjust line weights, annotate in TeX, colour things in, etc. The various editing windows can float free or be tiled, but getting them back in place drove me bananas… Data can be edited in by hand, or imported from plain text, csv, and FITS. You can only import one dataset at a time though (I think).  Veusz can do contours, vector fields, and and grayscale images, but it doesn’t do surface plots. You can’t plot a parametric function, but in the dataset editor you can create a dataset with a parametric function.You can also do column arithmetic to make new datasets. So it can do rather more than mjograph, but of course at the cost of just a little more complexity.

The really nice thing is that it is scriptable as well. Every GUI action has a corresponding Python command. The app comes with a console which is a Python window, with numpy already loaded. You can use this in a normal Pythonish way, but you can also issue Veusz commands or run a whole Veusz script. That nice Dr Sanders also provides callable libraries for C and C++, and says a Fortran library is on the way.  When you save a plot you have been working on, its actually a text file containing the Python commands, so you can edit this, and teach yourself the scripting version. Below is a plot I just made with the GUI, and its script equivalent. (Note mistake : “bump” should be “dip”). As you can see, its perfectly logical, but kinda laborious. So this is really nice, but I don’t see it as a replacement for Gnuplot or similar.

Link to the Veusz script to produce the above plot.

Topcat. Finally, a plug for good ole Topcat. If you are interested in tabular data, rather than functions, and want to explore the data rather than making fancy plots, then this is what you want. Where bees are concerned, it is the knees.