<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr">Hi all ,<div><br></div><div>I am using the script below to plot humidity between 40-70%(green) and 70-100% (orange).</div><div><br></div><div>I want to know if i can set the opacity for each color for example opacity 50% for the green color and 100% for the orange. </div>
<div><br></div><div>Thanks for help.</div><div><br></div><div><div>;************************************************</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div><div>;************************************************</div><div>begin</div><div> a = addfile("gfs.t00z.pgrb2f00.grib2","r")</div>
<div> lon = a->lon_0</div><div> lat = a->lat_0</div><div> icing = short2flt(a->RH_P0_L100_GLL0({50000},:,:))</div><div><br></div><div>print(icing(1:4,1:4))</div><div>;********************************************************</div>
<div>; Display parameters</div><div>;***************************************</div><div>zoom="test"</div><div>pixel=2048</div><div>;***************************************************</div><div><br></div><div>wks_type="png"</div>
<div><br></div><div> wks_type@wkWidth = pixel</div><div> wks_type@wkHeight = pixel</div><div> wks_type@wkBackgroundOpacityF = 0.0</div><div>wks = gsn_open_wks(wks_type,"icing_test")</div><div><br></div><div>
colors = (/ (/255,255,255/),(/0,0,0/),(/255,255,255/), (/244,255,244/), \</div><div> (/217,255,217/), (/163,255,163/), (/106,255,106/), \</div><div> (/43,255,106/), (/0,224,0/), (/0,134,0/),(/255,145,0/),\</div>
<div> (/255,178,102/) /) * 1.0 ; we multiply by 1 to make colors float</div><div><br></div><div>colors = colors/255.</div><div><br></div><div> </div><div>gsn_define_colormap(wks,colors)</div><div><br></div>
<div>
<br></div><div>res = True</div><div> res@mpProjection = "Mercator" ; choose projection</div><div> res@mpGridAndLimbOn = False ; turn on lat/lon lines</div><div> res@mpPerimOn = False ; turn off box around plot</div>
<div> res@mpFillOn = False</div><div> res@mpOutlineOn = True </div><div> res@cnFillOn = True ; color plot desired</div><div> res@cnLineLabelsOn = False ; turn off contour lines</div>
<div> res@mpLimitMode = "LatLon"</div><div> res@mpMinLatF = -85.0</div><div> res@mpMaxLatF = 85.0 </div><div> res@mpMinLonF = -180</div><div> res@mpMaxLonF = 180</div>
<div> res@vpXF = 0 ; make plot bigger</div><div> res@vpYF = 1 </div><div> res@vpWidthF = 1</div><div> res@vpHeightF = 1</div><div><br></div><div>res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels</div>
<div>res@cnLevels = (/ 40,70,100/)<span style="white-space:pre-wrap">        </span>; set levels</div><div>res@cnFillColors = (/ -1,5,11/)</div><div><br></div><div>;res@cnFillOpacityF=0.5</div></div><div> <br clear="all">
<div>contour0 = gsn_csm_contour_map(wks,icing,res) ; create the plot<br></div>-- <br><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br> <br><br></div>
</div></div>
<br></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div>
</div>