|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] ch.Set('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)' 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(¯11,²\²TOT[;2]>0)TOT FULLDaily © Rule off at latest data, and mark as 'Today' .... TD(calcode'TODAY')-¯1+calcode'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:PGch.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.