James Scott-Brown home about projects

Kite Diagrams

In ecology, measurements of abundance made along a transect are often represented on kite diagrams. Essentially, these are line graphs, in which each line is translated vertically so that it does not overlap the others, and reflected in its x-axis. The space between the reflections is then shaded.

Unfortunately, these are awkward to draw by hand. They are frequently plotted on graph paper in its landscape orientation, requiring that several sheets be stuck together in order to represent the full set of measurements. This is messy, and results in a low information density. Consequently, it is desirable to produce kite diagrams with a computer, rather than ruler and pen. Some suitable software exists, but mostly as plugins for Excel (EasyStats, Merlin), a proprietary software package with a long history of computational errors and inadequacies.

I therefore wrote my own program to draw kite diagrams. It accepts the name of a CSV file as its only argument. The first line of this file is a header specifying the labels to print at each tick on the x-axis. Subsequent lines consist of a species name, then list of measurements. Output is written to a file as postscript.

Example input file:

` 0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80 Sea pink, 0,0,0,0,3,0,0,6,6,3,0,0,8,22,0,0,0 Sea lavendar,0,0,0,0,0,0,0,4,0,0,30,0,16,16,17,0,0 Saltmarsh grass,0,0,0,0,0,15,0,0,0,0,50,100,49,50,83,100,0 Glasswort,10,0,35,5,0,40,8,4,0,0,20,0,11,1,0,0,0 Sea plantain,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0 Sea Purslane,0,1,4,77,0,27,52,0,0,0,0,0,12,11,0,0,0 Sea rush,0,0,0,0,0,18,38,34,6,0,0,0,0,0,0,0,0 Sea couch,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0 Cord Grass,22,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0 `


Example Kite Diagram

(PDF available.)

The perl script can be downloaded here. After downloading, change the extension from .txt to .pl .

blog comments powered by Disqus