the whiskers

Jennifer Adams jma at COLA.IGES.ORG
Thu Jan 22 14:01:17 EST 2009


To draw the box and whiskers, use 'set gxout bar' and 'set gxout
errbar'. Then give the display command two variables, separated by a a
semi-colon. Here's the script that I used to draw the first four plots
in the ensemble documentation:

'open gfsens.2009010100.ctl'
'set lon -60'
'set lat 45'
'set lev 500'
'set parea 1 9.7 2.5 6'
'set t 0.5 65.5'
'set e 1'
'clear'
'set grads off'
'set tlsupp year'
'set cmark 0'
'set vrange 4950 5600'
'set ylint 100'
'd hgt'
'printim edemo1.png '

* Remaining members
e=2
cols='2 3 4 5 6 8 9 10 11 12 13 14 2 3 4 5 6  8 9 10 11 12 13 14 2 3 4
5 6 7 8 9 10 11 12 13 14 '
while (e<=21)
   'set e 'e
   c=subwrd(cols,e)
   'set ccolor 'c
   'set cmark 0'
   'd hgt'
   e=e+1
endwhile
'printim edemo2.png '

* all 21 members drawn as shaded boxes
'clear'
'set gxout grfill'
'set e 0.5 21.5'
'set clevs  5100 5150 5200 5250 5300 5350 5400 5450 '
'set ccols 14   4    11   5    3    7    12   8    2    '
'set grads off'
'set tlsupp year'
'd hgt'
'cbarn 0.8 1'
'printim edemo3.png'

* Calculate the ensemble mean
'set e 1'
'set t 1 last'
'define ensmean=ave(hgt,e=1,e=21)'

* Calculate the variance
diffsq = 'pow(hgt-ensmean,2)'
variance = 'ave('diffsq',e=1,e=21)'
'define stddev=sqrt('variance')'

* Calculate the min/max
'define ensmin=tloop(min(hgt,e=1,e=21))'
'define ensmax=tloop(max(hgt,e=1,e=21))'

* Plot the results
'clear'
'set t 0.5 65.5'
'set vrange 4950 5600'
'set ylint 100'
'set tlsupp year'
'set grads off'

* Draw error bars for min/max
'set gxout errbar'
'set ccolor 4'
'd ensmin;ensmax'

* Draw bars for +/- standard deviation
plus  = '(ensmean+stddev)'
minus = '(ensmean-stddev)'
'set gxout bar'
'set bargap 50'
'set baropts outline'
'set ccolor 3'
'd 'minus';'plus

* Draw line for Ensemble mean
'set gxout line'
'set cmark 0'
'set cthick 6'
'set digsiz 0.05'
'set ccolor 2'
'd ensmean'

'printim edemo4.png'



On Jan 21, 2009, at 7:39 PM, Hsin-Hsing,Chia wrote:

> Hi Jennifer:
> Thanks for your effort on the documentation about the ensemble
> dataset.
> How to plot the figure 4, which has the blue whiskers in this
> documentation ?
>
> Thanks
>
> Hsin-Hsing

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090122/daff9600/attachment.html 


More information about the gradsusr mailing list