[gradsusr] color levels
Jeff Duda
jeffduda319 at gmail.com
Wed Jan 4 11:23:01 EST 2017
Use gxout fgrid to plot a discrete field and set fgvals to set the values
and colors for each discrete value.
Jeff Duda
On Wed, Jan 4, 2017 at 4:24 AM, Nibin Gopi <nibingopi10 at gmail.com> wrote:
> i want to plot only 0 and 1 in my color bar bur a range is coming between
> 0 and 1. what i will do for that . here the programme
>
> 'reinit'
> 'open cnt_2014-09-25_d03.ctl'
> 'set t 1'
> 'define var = t2'
> i=1
> while(i<=324)
> j=1
> while(j<=324)
> 'q defval var 'i' 'j
> val = subwrd(result,3)
> if (val>= 295.0 & val <= 298 )
> 'set defval var 'i' 'j' '1
> endif
> if (val > 298.0 )
> 'set defval var 'i' 'j' '0
> endif
> j=j+1
> endwhile
> i=i+1
> endwhile
> 'set gxout grfill'
> 'set clevs 0 1 '
> 'set ccols 2 3 '
> *'d var'
> *'run cbarn'
> *'printim 1.png white'
>
> ***********************************************************
> 'define var1=rh2'
> 'set t 1'
> i=1
> while(i<=324)
> j=1
> while(j<=324)
> 'q defval var1 'i' 'j
> val1=subwrd(result,3)if (val1 >= 50.0 & val1 <= 60.0 )
> 'set defval var1 'i' 'j' '1
> endif
> if (val1 > 60 )
> 'set defval var1 'i' 'j' '0
> endif
> j=j+1
> endwhile
> i=i+1
> endwhile
> 'set gxout grfill'
> 'set clevs 0 1'
> 'set ccols 2 3'
> 'd var1'
> 'run cbarn.gs'
> 'printim 2.png white'
> *********************************************************888
> 'define var2=rainc+rainnc'
> 'set t 1'
> 'define var2=rainc+rainnc'
> i=1
> while(i<=324)
> j=1
> while(j<=324)
> 'q defval var2 'i' 'j
> val2=subwrd(result,3)
> if (val2 >= 75.0 & val2 <= 175.0 )
> 'set defval var2 'i' 'j' '1
> endif
> if (val2 > 175.0 )
> 'set defval var2 'i' 'j' '0
> endif
> j=j+1
> endwhile
> i=i+1
> endwhile
> 'set gxout grfill'
> 'set clevs 0 1'
> 'set ccols 2 3'
> *'d var2'
> 'run cbarn.gs'
> 'printim 3.png white'
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
--
Jeff Duda
Post-doctoral research fellow
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170104/ffabe66a/attachment.html
More information about the gradsusr
mailing list