Search Locate Previous Next Contents

The Gilling East Rainfall Chart

This chart explains the existence of the Rain workspace! It was devised in 1990 as an effective means of plotting the data from Richard Smith’s weather station (a suitable Christmas present for a 7-yr old), and drove the development of this graphics toolkit.

 R„Rain YR;DOM;MAT;TD;RN;HD;TOT;FULL 
© Build 'YR' rainfall graph from various bits 
 DOM„LEAP YR ª YR„•''½YR ª RN„–'‘RAIN‘',YR 
 TOT„DOM TOT‘MTHS RN ª FULL„0¬TOT[12;2] 
 ch.Set('STYLE' 'BOXED,NORISERS,VALUES')('HMAR' 36 60)('Xstyle' 'LABMID')('nstyle' 'opaque') 
 HD„' Rainfall at Gilling East',FULL/';Annual Total =',(0•+/RN),'mm' 
 HD„HD,FULL/' (',(1‡1•(+/RN)÷25.4),'in)' 
 ch.Set'HEAD'('19',YR,HD) 
 ch.Set('XLAB' 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec')
('XT'(0,+\DOM)) ch.Set('Ystyle' 'GRID,ATEND')('YCAPTION' 'mm')('YTICK' 10 4) ch.Set('COLOUR' 'blue,neutral')('PATTERN' 1) © Draw completed months only ... ch.Set('YRANGE'(0,110——/TOT[;2]))('YDATUM' 25.4) ch.Step(¯1‡1,²Ÿ\²TOT[;2]>0)šTOT …FULL†Daily © Rule off at latest data, and mark as 'Today' .... TD„(cal‘code'TODAY')-¯1+cal‘code'1 1 ',YR ch.Set'datum' 'cy,DD,FINE' ch.Set'XDATUM'TD ª ch.Note'Today'((TD-2),95 90) Daily:MAT„(¼½RN),0,[1.5]RN ch.Set'STYLE' 'XYPLOT' ch.Vline(MAT[;3]>0)šMAT Exit:PG„ch.Close R„'View PG © to see graph for 19',YR,' rainfall'

Note the calculation of the number of days in the month, and the use of this to place the X-axis tick marks correctly. Another unusual feature is the computed datum line at ‘Today’ which is written vertically up the line.



Continue to: Playfair Revisited
© Copyright Causeway Graphical Systems Ltd 2003