[gradsusr] Setting color bar for animation

Goodson,Ron [Edm] Ron.Goodson at EC.gc.ca
Tue Mar 22 18:23:24 EDT 2011


I see in my original note I mislead you .. when I said I do my
make_clevs.gs before cbar.  As was noted by Jeffrey . the settings of
clevs, ccols (all that stuff) must happen before the display of the
variable.  So swap those two lines of "display" and "make_clevs".
 
 
 
The other thing I usually do right at the start of my programs (and only
has to be done once .. unlike settings clevs, ccols which must be done
before each display)  is to setup some custom colours through "set rgb"
(one entrie per colour) and rbcols (to set the order of the colours).
You don't need to do this if you are using the GrADS standard scheme of
16 colours.
 
 
ron

________________________________

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


OK, that make_clevs works for me when I do a simple 'd' on my variable,
but when I try to use a little fancier script (not even an animation,
just trying to pass the range on the command line), I lose the min and
max values.   

If I do:

c
make_clevs 0 2 0.2
d soilwat5
cbar

I get a colorbar from 0 to 2 in steps of .2, even though the variable
range is 0 to 1 (so far, so good).

If I do:
 
dd soilwat5 -cmin 0 -cmax 2 -cint 0.2

I get a colorbar from 0 to 1 in steps of 0.2.  The colors are the same
for the different ranges, it just doesn't show the ones above 1.  Is
this because clevs are set and ccols are not?  I was hoping ccols would
get set automatically like it does when you don't specify levels.

This happens whether or not I use the make_clevs line in the following
script.

BTW, this seems really basic, but I can't figure out how to see the
current values of ccols and clevs.
cbar is getting its ccols and clevs from 'q shades', but it doesn't
react to ccols and clevs until a plot has been made.

Script follows.

Thanks for the help,
Clay

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

variable=subwrd(args,1)

ccint=''
ccmin=''
ccmax=''
string=''
space=' '
n=2

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

'c'
'set gxout shaded'
if(ccint!=''); 'set cint 'ccint;endif
if(ccmin!=''); 'set cmin 'ccmin;endif
if(ccmax!=''); 'set cmax 'ccmax;endif
if(ccmin!=''); if(ccmax!=''); 'set rbrange 'ccmin ' 'ccmax; endif;endif
'd 'variable

*CBB 3/22/11 set the levels
'make_clevs ' cmin cmax cint

'cbar'

return
**************END dd.gs **************************



-- 
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/20110322/4da3cd44/attachment-0003.html 


More information about the gradsusr mailing list