| Search Locate Previous Next | Contents |
This chart explains the existence of the Rain workspace! It was devised in 1990 as an effective means of plotting the data from Richard Smiths weather station (a suitable Christmas present for a 7-yr old), and drove the development of this graphics toolkit.
RRain YR;DOM;MAT;TD;RN;HD;TOT;FULL
© Build 'YR' rainfall graph from various bits
DOMLEAP YR ª YR''½YR ª RN'RAIN',YR
TOTDOM TOTMTHS RN ª FULL0¬TOT[12;2]
chSet('STYLE' 'BOXED,NORISERS,VALUES')('HMAR' 36 60)('Xstyle' 'LABMID')('nstyle' 'opaque')
HD' Rainfall at Gilling East',FULL/';Annual Total =',(0+/RN),'mm'
HDHD,FULL/' (',(11(+/RN)÷25.4),'in)'
chSet'HEAD'('19',YR,HD)
chSet('XLAB' 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec')
('XT'(0,+\DOM))
chSet('Ystyle' 'GRID,ATEND')('YCAPTION' 'mm')('YTICK' 10 4)
chSet('COLOUR' 'blue,neutral')('PATTERN' 1)
© Draw completed months only ...
chSet('YRANGE'(0,110/TOT[;2]))('YDATUM' 25.4)
chStep(¯11,²\²TOT[;2]>0)TOT
FULLDaily
© Rule off at latest data, and mark as 'Today' ....
TD(calcode'TODAY')-¯1+calcode'1 1 ',YR
chSet'datum' 'cy,DD,FINE'
chSet'XDATUM'TD ª chNote'Today'((TD-2),95 90)
Daily:MAT(¼½RN),0,[1.5]RN
chSet'STYLE' 'XYPLOT'
chVline(MAT[;3]>0)MAT
Exit:PGchClose
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.