Add to Google Reader or Homepage |
~ pjvenda / blog
$home . blog . photography

01 June 2008

Gnuplot in action

For us, mere humans, it is so much easier to understand technical data if it is presented in some form of graphical form - instead of tables filled with numbers. Coloured bars are easier to compare than two numbers side by side. In the same way, an analog voltmeter can, more clearly, show an abnormal condition, where the needle pointer moves too far than what we're expecting. But I stray from the subject...

So I like statistics, and I like graphs, and I blog about it. And then I'm suggested [by the author] an upcoming book about gnuplot: "Gnuplot in action".

You see, 'gnuplot' is a wonderful tool that takes data and draws (or plots) graphs to some output format (like an X window or an image file).
It's an incredibly compact unix-style tool that takes a configuration script and a text table of data (usually numbers and column names) to plot the graph into an image of some kind. It offers thousands of options and configuration parameters to produce pretty much every graph you might imagine [and beyond]. From useless to essential, from the very simple to mind-bogling complicated and elaborate. All for the sake of a better representation of "raw" data.

set term png
set output "sin_x.png"
plot sin(x)

The trivial script above makes gnuplot plot the graph shown in the image below:

Graphical plot of sin(x).

This slightly more elaborate script seen in plots the almost art-work graph shown below:

Graphical plot of a transfer function. This is the result of a complex gnuplot script.

The truth is that although gnuplot is does a superb job, it carries a pretty steep learning curve. Most of it I've learnt from examples, which obviously isn't enough.

And here is where "gnuplot in action" comes in. It's a book that tackles the depths of gnuplot, from the simple and straightforward all the way up to the very edge of its capabilities - the scripts of the gnuplot gods. It is also filled with reference material and examples.
The subject is introduced progressively. It says somewhere that the first few chapters alone cover pretty much every basic function of the program. The remaining are the meat of the book, the extra mile that makes it interesting. It's a great read and a really nice way to explore gnuplot, graphs and statistics (for those that, like me, have the little bug of statistics inside them).

I reckon that pretty much every unix-head sysadmin must have thought about using gnuplot, or at least uses a couple tools that produce graphics with it.

The book isn't ready just yet, you'll have to wait a couple more weeks, but if you do any work that does or may involve gnuplot, go on and buy this book. It's bloddy brilliant.

Here is the link again:

Cheers, PJ.


Carlos Silva said...

I must say that I was quite scared of Gnuplot in the past. But when I had to present the results of my findings for my graduation thesis I tried to do them with Excel and it was simple unbearable. The resulting graphics looked lame, it was very difficult to fine tune the result and it was a monster nightmare to redo the graphics after changing the structure of the results.
After a quick look into some examples it became obvious that Gnuplot was the way to go. And I was surprised to discover that it was a lot easier than I though. In no time I was doing complex 3D graphs with the flexibility I needed. But a book would certainly have helped.

(No... this is not a marketing post sponsored by Gnuplot ;) )

pjvenda said...

And I am sure that you are not the only one that had such experience.