<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.17095" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011>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".</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011>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.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=015501622-22032011>ron</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> gradsusr-bounces@gradsusr.org
[mailto:gradsusr-bounces@gradsusr.org] <B>On Behalf Of </B>Clay
Blankenship<BR><B>Sent:</B> March 22, 2011 4:05 PM<BR><B>To:</B> GrADS Users
Forum<BR><B>Subject:</B> Re: [gradsusr] Setting color bar for
animation<BR></FONT><BR></DIV>
<DIV></DIV>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.
<DIV><BR></DIV>
<DIV>If I do:</DIV>
<DIV><BR></DIV>
<DIV>c</DIV>
<DIV>make_clevs 0 2 0.2</DIV>
<DIV>d soilwat5</DIV>
<DIV>cbar</DIV>
<DIV><BR></DIV>
<DIV>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).</DIV>
<DIV><BR></DIV>
<DIV>If I do:</DIV>
<DIV> </DIV>
<DIV>dd soilwat5 -cmin 0 -cmax 2 -cint 0.2</DIV>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>This happens whether or not I use the make_clevs line in the following
script.</DIV>
<DIV><BR></DIV>
<DIV>BTW, this seems really basic, but I can't figure out how to see the current
values of ccols and clevs.</DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>Script follows.</DIV>
<DIV><BR></DIV>
<DIV>Thanks for the help,</DIV>
<DIV>Clay</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>**************BEGIN dd.gs **************************</DIV>
<DIV>
<DIV>function main (args)</DIV>
<DIV>*Plot a variable and its color scale.</DIV>
<DIV>* dd variable [ -cmin minimum value ]</DIV>
<DIV>* [ -cmax maximum value ]</DIV>
<DIV>* [ -cint color scale ]</DIV>
<DIV><BR></DIV>
<DIV>variable=subwrd(args,1)</DIV>
<DIV><BR></DIV>
<DIV>ccint=''</DIV>
<DIV>ccmin=''</DIV>
<DIV>ccmax=''</DIV>
<DIV>string=''</DIV>
<DIV>space=' '</DIV>
<DIV>n=2</DIV>
<DIV><BR></DIV>
<DIV>while(n<9)</DIV>
<DIV>idx=subwrd(args,n)</DIV>
<DIV>opt=subwrd(args,n+1)</DIV>
<DIV>if(idx='');break;endif</DIV>
<DIV>if(idx='-cint');ccint=opt;endif</DIV>
<DIV>if(idx='-cmin');ccmin=opt;endif</DIV>
<DIV>if(idx='-cmax');ccmax=opt;endif</DIV>
<DIV>if(idx='-string');string=opt;endif</DIV>
<DIV>n=n+2</DIV>
<DIV>endwhile</DIV>
<DIV><BR></DIV>
<DIV>'c'</DIV>
<DIV>'set gxout shaded'</DIV>
<DIV>if(ccint!=''); 'set cint 'ccint;endif</DIV>
<DIV>if(ccmin!=''); 'set cmin 'ccmin;endif</DIV>
<DIV>if(ccmax!=''); 'set cmax 'ccmax;endif</DIV>
<DIV>if(ccmin!=''); if(ccmax!=''); 'set rbrange 'ccmin ' 'ccmax;
endif;endif</DIV>
<DIV>'d 'variable</DIV>
<DIV><BR></DIV>
<DIV>*CBB 3/22/11 set the levels</DIV>
<DIV>'make_clevs ' cmin cmax cint</DIV>
<DIV><BR></DIV>
<DIV>'cbar'</DIV>
<DIV><BR></DIV>
<DIV>return</DIV></DIV>
<DIV>
<DIV>**************END dd.gs **************************</DIV>
<DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>
<DIV apple-content-edited="true">
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><SPAN
class=Apple-style-span
style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><SPAN
class=Apple-style-span
style="WORD-SPACING: 0px; FONT: 12px Monaco; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><SPAN
class=Apple-style-span
style="WORD-SPACING: 0px; FONT: 12px Monaco; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV>
<DIV>
<DIV>
<DIV>-- </DIV>
<DIV>Clay Blankenship *
USRA Research Scientist</DIV></DIV>
<DIV>
<DIV>
<DIV>
<DIV><A
href="mailto:clay.b.blankenship@nasa.gov">clay.b.blankenship@nasa.gov</A>
* 256-961-7638</DIV></DIV></DIV></DIV>
<DIV>320 Sparkman Drive *
Huntsville, AL 35805 USA</DIV></DIV></DIV>
<DIV>National Space Science and Technology Center at
NASA-MSFC/UAH</DIV><BR></DIV></SPAN><BR
class=Apple-interchange-newline></DIV></SPAN><BR
class=Apple-interchange-newline></DIV></SPAN><BR
class=Apple-interchange-newline></DIV><BR
class=Apple-interchange-newline></DIV><BR></DIV></DIV></BODY></HTML>