[gradsusr] Setting color bar for animation

Clay Blankenship clay.b.blankenship at nasa.gov
Tue Mar 22 18:04:39 EDT 2011


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/bfe3d7b7/attachment-0003.html 


More information about the gradsusr mailing list