<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Stavros,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We have it on our list to add a "cnFillOpacities" resource (NCL-2058) which will allow you to individually specify opacities for each level.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are a few other ways to specify the opacity for each contour level. One of them is by using RGBA arrays to define the colors, so that you can then set the "A" component of these arrays to a value from 0 to 1 to indicate the level of opacity you want.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Since you are using named colors to define the contour colors, then you can use the "namedcolor2rgba" function to convert them to an RGBA array, and set the transparencies there.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See the attached example, which you should be able to run as-is.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 8:09 AM, Stavros Dafis <span dir="ltr"><<a href="mailto:sdafis@cc.uoi.gr" target="_blank">sdafis@cc.uoi.gr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello from Paris,<br>
<br>
I am trying to overlay 3 shaded contours in a cross section plot and the only<br>
way that I have found to make this is by using the "cnFillOpacityF" for every<br>
contour. Is there any other way to overlay these variables (graupel, ice,<br>
snow)? I have attached a link with my plot and part of my code:<br>
<br>
Plot : <a href="http://oi62.tinypic.com/2iszdyx.jpg" rel="noreferrer" target="_blank">http://oi62.tinypic.com/2iszdyx.jpg</a><br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; Plotting options for Ice<br>
opts_qi = opts_xy<br>
;opts_qi@ContourParameters = (/ 0., 1., 0.2 /)<br>
opts_qi@pmLabelBarOrthogonalPosF = 0.1<br>
;opts_qi@lbOrientation = "vertical" ; vertical<br>
label bar<br>
;opts_qi@pmLabelBarSide = "Right"<br>
opts_qi@cnFillOn = True<br>
opts_qi@cnFillOpacityF = 0.8<br>
opts_qi@cnFillColors =<br>
(/"White","WhiteSmoke","Chartreuse","Green","Green1","Green2","Green3",\<br>
"DarkGreen","DarkOliveGreen4"/)<br>
<br>
;colors2 = read_colormap_file("MPL_winter")<br>
;opts_qi@cnFillColors = colors2<br>
;opts_qi@gsnSpreadColorEnd = -1 ; End third from the last<br>
color in color map<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; Plotting options for Snow<br>
opts_qs = opts_xy<br>
;opts_qs@ContourParameters = (/ 0., 3., 0.5 /)<br>
opts_qs@pmLabelBarOrthogonalPosF = 0.3<br>
;opts_qs@pmLabelBarParallelPosF = 0.6<br>
;opts_qs@pmLabelBarSide = "Right"<br>
;opts_qs@lbOrientation = "vertical" ; vertical<br>
label bar<br>
opts_qs@cnFillOn = True<br>
opts_qs@cnFillOpacityF = 0.9<br>
opts_qs@cnFillColors =<br>
(/"White","WhiteSmoke","Gray85","DodgerBlue","DodgerBlue1","DodgerBlue2","DodgerBlue3",<br>
\<br>
<br>
"DodgerBlue4","SteelBlue","SteelBlue1","SteelBlue2"/)<br>
;colors3 = read_colormap_file("CBR_wet")<br>
;opts_qs@cnFillColors = colors3<br>
;opts_qs@gsnSpreadColorEnd = -1 ; End third from the last<br>
color in color map<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; Plotting options for Temperature<br>
opts_tc = opts_xy<br>
opts_tc@cnInfoLabelZone = 1<br>
opts_tc@cnInfoLabelSide = "Top"<br>
opts_tc@cnInfoLabelPerimOn = True<br>
opts_tc@cnInfoLabelOrthogonalPosF = -0.00005<br>
opts_tc@ContourParameters = (/ 5. /)<br>
<br>
;Contour terrain cross section<br>
contour_ter = gsn_csm_xy(wks,X_plane,ter_plane,opts_ter)<br>
<br>
<br>
; Get the contour info for the rh and temp (the 2 plots have smooth<br>
terrain)<br>
contour_tc2 = wrf_contour(a,wks,tc_plane2(0:zmax_pos,:),opts_tc)<br>
contour_qg2 = wrf_contour(a,wks,qg_plane2(0:zmax_pos,:),opts_qg)<br>
contour_qi2 = wrf_contour(a,wks,qi_plane2(0:zmax_pos,:),opts_qi)<br>
contour_qs2 = wrf_contour(a,wks,qs_plane2(0:zmax_pos,:),opts_qs)<br>
;contour_GIS2 = wrf_contour(a,wks,GIS_plane2(0:zmax_pos,:),opts_GIS)<br>
<br>
;--------------------------------------------------------------------------<br>
; MAKE PLOTS<br>
<br>
if (FirstTimeMap) then<br>
lat_plane = wrf_user_intrp2d(xlat,plane,angle,opts)<br>
lon_plane = wrf_user_intrp2d(xlon,plane,angle,opts)<br>
mpres = True<br>
pltres = True<br>
pltres@FramePlot = False<br>
optsM = res<br>
optsM@NoHeaderFooter = True<br>
optsM@cnFillOn = True<br>
optsM@lbTitleOn = False<br>
contour = wrf_contour(a,wks,ter,optsM)<br>
;plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)<br>
lnres = True<br>
lnres@gsLineThicknessF = 2.0<br>
lnres@gsLineColor = "Red"<br>
; do ii = 0,dimsX(0)-2<br>
;<br>
gsn_polyline(wks,plot,(/lon_plane(ii),lon_plane(ii+1)/),(/lat_plane(ii),lat_plane(ii+1)/),lnres)<br>
;end do<br>
frame(wks)<br>
delete(lon_plane)<br>
delete(lat_plane)<br>
;pltres@FramePlot = True<br>
; pltres@PanelPlot = True<br>
end if<br>
<br>
plot =<br>
wrf_overlays(a,wks,(/contour_qs2,contour_qi2,contour_qg2,contour_tc2,contour_ter/),pltres)<br>
; plot x-section<br>
<br>
<br>
<br>
<br>
thank you in advance for any comments!<br>
<br>
<br>
<br>
--<br>
Stavros Dafis<br>
MSc student Atmospheric Sciences and Environment<br>
University of Ioannina<br>
LATMOS Laboratoire Atmosph&#232;res, Milieux,Observations Spatiales; Versailles,<br>
France.<br>
Tel: <a href="tel:%2B30%202651008499" value="+302651008499">+30 2651008499</a>, Mobile: <a href="tel:%2B30%206970420242" value="+306970420242">+30 6970420242</a><br>
e-mails: <a href="mailto:sdafis@noa.gr">sdafis@noa.gr</a> or <a href="mailto:dafis91@yahoo.gr">dafis91@yahoo.gr</a> or <a href="mailto:sdafis@cc.uoi.gr">sdafis@cc.uoi.gr</a><br>
Weather charts: <a href="http://www.metar.gr" rel="noreferrer" target="_blank">http://www.metar.gr</a><br>
<a href="http://www.meteovolos.gr" rel="noreferrer" target="_blank">http://www.meteovolos.gr</a><br>
<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>