[gradsusr] Setting color bar for animation

Goodson,Ron [Edm] Ron.Goodson at EC.gc.ca
Wed Mar 23 18:18:21 EDT 2011


I looked in one of my scripts where I calculate the min, max.
 
You are correct .. it is only seeing the first value.
 
You need
 
'make_clevs 'vaule_1' 'value_2' 'value_3
 
.. you need the spaces between the values...
 
ron
 

________________________________

From: gradsusr-bounces at gradsusr.org
[mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Clay Blankenship
Sent: March 23, 2011 4:11 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] Setting color bar for animation


OK, I think I am starting to understand, but it's odd that you can do  
set ccols
d var
cbar      (resetting clevs/ccols?)
d var
cbar

and after the first 'd var' cbar has the original shading info but not
the second time.  The ccols/clevs must not be the thing that determines
the color bar scale, which is what is throwing me off.

Anyway, why does the following not work?

If I hard-code dd.gs to 'make_clevs 0 2 .2' I get the color bar from 0
to 2 like I want.  If I pass the parameters and do 'dd soilwat5 -cmin 0
-cmax 2 -cint .2', it gets the values (the "say" command prints the
expected numbers) but the color bar only goes to 1 (the max data value).
Am I putting quotation marks in the right place.  I am not sure
make_clevs is getting the three values.

Clay




function dd (args)
*Plot a variable and its color scale.
* dd variable [ -cmin minimum value ]
*             [ -cmax maximum value ]
*             [ -cint color scale ]

variable=subwrd(args,1)

cint=''
cmin=''
cmax=''
n=2

while(n<7)
idx=subwrd(args,n)
opt=subwrd(args,n+1)
if(idx='');break;endif
if(idx='-cint');cint=opt;endif
if(idx='-cmin');cmin=opt;endif
if(idx='-cmax');cmax=opt;endif
n=n+2
endwhile

'c'
'set gxout shaded'
say cint
say cmin
say cmax

'make_clevs ' cmin cmax cint

'd 'variable


'cbar2'




-- 
Clay Blankenship                 * USRA Research Scientist
clay.b.blankenship at nasa.gov      * 256-961-7638
320 Sparkman Drive               * Huntsville, AL 35805 USA
National Space Science and Technology Center at NASA-MSFC/UAH






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110323/2dba07a8/attachment-0003.html 


More information about the gradsusr mailing list