Search Locate Previous Next Contents

The History and Evolution of Rain

Why Rain?

All I wanted to do was to plot the records from our daily rainfall readings on a simple chart, showing monthly totals as a backcloth and a vertical line for each (non-zero) daily amount. Clearly I wanted the scale labelled up in months, with the captions centred between the tick marks, but unfortunately months have different numbers of days, so my tick-mark spacing would have to be irregular! This started me down the road of applying the syntax of IBM’s PGF package (which is still one of the best around) to the problem of drawing quite sophisticated statistical graphics with the minimum of extraneous junk.

Why PostScript?
I was lucky in one important respect: I had just become interested in the PostScript language, and by coding in the union of PostScript and APL I was able to separate the logical design from the physical necessity to render the finished graphic on the screen or to paper. This allowed me to write the bulk of the code independently of the graphics software, as it simply constructs a character vector of PostScript code.

I then had the rather simpler problem of writing the APL functions (e.g. MOVETO, SHOW) which write lines and text to the screen. Because these were quite compact, it was easy to take my first attempt (in APL*PLUS/PC with ŒG style graphics) and redo it for the Windows interpreters. As you would expect, the improvement in quality was startling.

An advantage in working with PostScript in the APL*PLUS/PC environment was that anyone lucky enough to have a suitable printer could already generate publication-quality output, while the rest of us were stuck with low-resolution screen dumps. With Windows the problem is much reduced, as the graphs can be rendered on to any good-quality printer (such as an HP DeskJet or LaserJet). However I have retained the option of writing direct to the printer, because it is around 10 times faster than going via the Windows printer queue! It may also be useful to provide output files in .EPS form so that word-processor users can included them as graphics, so I left this in too. As the Adobe Acrobat format becomes more popular for publishing on the Internet, it is good to know that the output from Rain is in ideal format for input to the Adobe Distiller.

The functions offered by Rain have changed little over the years, as the basic set of line and bar graphs seemed all I needed. The major change in the Windows release has been to modify the syntax to match the ŒW calls of the native Windows-APL objects. This greatly reduces the number of functions you need in the workspace, as chSet now handles nearly everything. This makes for easy maintenance, and keeps name-clash problems to a minimum.

Where next?
This version of Rain has limited 3D capabilities for a range of charts which have seemed useful to me at various times. It continues to avoid spurious decorations and pointless perspective effects! Now that the basic functions are in place to draw mesh surfaces, towers and scatter plots, it would be relatively easy to extend this capability to a wider range of plots. Please let me know what would be useful – Polar charts are a recent addition which came from a user-request and contour plotting is next on the list.


Continue to: Using the Chart Viewer
© Copyright Causeway Graphical Systems Ltd 2003