<div dir="ltr"><div><div><div><div><div>A clever use of the const() and maskout() functions will give you the desired result. The reason you are only seeing one field in the end is that every time you run a display command with gxout set as shaded or grfill, the latter field is covering up the former field anywhere the colors are not the background value or a transparent color.<br><br></div>An example of how to use the const() and maskout() functions for the t2 field would be:<br></div>To limit the field to only values below 298 K...<br></div>&#39;define var = const(maskout(t2,298-t2),0,-u)<wbr>&#39;<br></div>The above command would set all areas where t2 &gt; 298 K to 0 and leave all other areas untouched. You can nest this field within another set of const(maskout(...)) functions to handle the other end (&lt; 295) and yet another one for the 1s in the middle. One way to keep this command from getting ugly is to partition it...<br></div><div>&#39;define part1 = const(maskout(t2,298-t2),0,-u)<wbr>&#39;<br></div><div>&#39;define part2 = const(maskout(part1,part1-295)<wbr>,0,-u)&#39;<br></div><div>&#39;define part3 = const(part2,1)&#39;<br></div><div>&#39;define var = part3&#39;<br></div><div><br></div>Jeff Duda<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 27, 2016 at 2:24 AM, Nibin Gopi <span dir="ltr">&lt;<a href="mailto:nibingopi10@gmail.com" target="_blank">nibingopi10@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>i have do the follwing code for ploting constant field according to some condition satisfied. but it only shows one green color plot all over the map(i attched the fig)<br><br></div>the code is <br><br><br><br>&#39;open cnt_2014-09-25_d03.ctl&#39;<br>&#39;set t 1&#39;<br>&#39;define var = t2&#39;<br>&#39;define var1=rh2&#39;<br>&#39;define var2=rainc+rainnc&#39;<br>i=1<br>while(i&lt;=324)<br>j=1<br>while(j&lt;=324)<br>&#39;q defval var &#39;i&#39; &#39;j<br>&#39;q defval var1 &#39;i&#39; &#39;j<br>&#39;q defval var2 &#39;i&#39; &#39;j<br>val = subwrd(result,3)<br>val2=subwrd(result,3)<br>val3=subwrd(result,3)<br><br>if (val &gt; 295.0 &amp; val &lt; 298 )<br>  &#39;set defval var &#39;i&#39; &#39;j&#39; &#39;1<br>endif<br>if (val &gt; 298.0 )<br>  &#39;set defval var &#39;i&#39; &#39;j&#39; &#39;0<br>endif<br>if (val1 &gt; 50.0 &amp; val1 &lt; 60.0 )<br>  &#39;set defval var1 &#39;i&#39; &#39;j&#39; &#39;2<br>endif<br><br>if (val1 &gt; 60 )<br>  &#39;set defval var1 &#39;i&#39; &#39;j&#39; &#39;3<br>endif<br>if (val2 &gt; 75.0 &amp; val2 &lt; 175.0 )<br>  &#39;set defval var2 &#39;i&#39; &#39;j&#39; &#39;4<br>endif<br><br>if (val2 &gt; 175.0 )<br>  &#39;set defval var2 &#39;i&#39; &#39;j&#39; &#39;5<br>endif<br>j=j+2<br>endwhile<br>i=i+1<br>endwhile<br>&#39;set gxout grfill&#39;<br>&#39;set clevs 0 1 2 3 4 5&#39;<br>&#39;set ccols 2 3 10 6 8 15&#39;<br>&#39;d var&#39;<br>&#39;d var1&#39;<br>&#39;d var2&#39;<br>&#39;run <a href="http://cbarn.gs" target="_blank">cbarn.gs</a>&#39;<br>&#39;printim 1.png white&#39;<br>&#39;quit&#39;<br></div>      <br><br></div>please give me some solution<br><br><br><br><br><img alt="Inline image 1" src="cid:ii_1593f610c6688d47" width="336" height="435"><br>                           <br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research fellow<br>University of Oklahoma School of Meteorology<br></div></div></div></div></div>
</div>