<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You need to pass both curves to a single plotting call so it knows where to fill. &nbsp;e.g.<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">wks = gsn_open_wks("X11","")</div><div class="">&nbsp;</div><div class="">x = fspan(1,10,50)</div><div class="">y = sin(x)</div><div class="">y1 = sin(x)+2</div><div class=""><br class=""></div><div class="">res = True</div><div class="">res@gsnXYFillColors = "Red"</div><div class="">&nbsp;</div><div class="">plot = gsn_csm_xy(wks, x, (/y,y1/), res)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">so in your case</div><div class=""><br class=""></div><div class="">….</div><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="gmail_quote"><div dir="ltr" class=""><div class=""><div class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(0)</div><div class="">res@gsnXYFillColors = colors(0)<br class="">plot0 = gsn_csm_xy(wks,x,(/fldmeanx, fidmeany/),res) &nbsp; &nbsp;</div></div></div></div></div></div></div></div></div></div></div></div><div class=""><br class=""></div><div class="">….</div><div class=""><br class=""></div><div class="">&nbsp;then delete the following plot and overlay as it’s no longer needed. &nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Any problems, reply to ncl-talk with updated questions and code.&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">##############################<br class="">Alan Brammer,<div class="">Post-Doc Researcher</div><div class=""><br class=""></div><div class="">Department of Atmospheric and&nbsp;Environmental Sciences,<br class="">University at Albany,&nbsp;State University of New&nbsp;York,&nbsp;Albany, NY, 12222<div class=""><a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a><br class="">##############################</div></div></div></span></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 12 Feb 2016, at 11:32, Ruksana Abedin &lt;<a href="mailto:ruksana.abedin@gmail.com" class="">ruksana.abedin@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class="">Dear NCL,<br class=""><br class=""></div>in connection to my earlier query, I need to add information that the first two curves have monthly mean precipitation values, which are meant to be the max and min range simulated by the model. So, filling in with color in between curve 1 and 2 will show the model range.<br class=""><br class=""></div>Making this filled xy curve as the plot0, I need to overlay all the other lines over it. <br class=""><br class=""></div>Please help me to do this. I have gone through the examples given at NCL website but can't figure out the required commands for my case. <br class=""><br class=""></div>Thanks a lot for your kind support,<br class=""></div>Ruksana<br class=""><br class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="gmail_quote">---------- Forwarded message ----------<br class="">From: <b class="gmail_sendername">Ruksana Abedin</b> <span dir="ltr" class="">&lt;<a href="mailto:ruksana.abedin@gmail.com" class="">ruksana.abedin@gmail.com</a>&gt;</span><br class="">Date: Thu, Feb 11, 2016 at 5:36 PM<br class="">Subject: how to fill in between two curves? Please help to sort this out<br class="">To: NCL-talk &lt;<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>&gt;<br class=""><br class=""><br class=""><div dir="ltr" class=""><div class="">Hi,<br class=""><br class=""></div>I need to fill in with color in between my first two curves (both grey lines in figure) but not sure how to do this. I have tried&nbsp; adding these lines but error message says one mudt be 2D other 1D. Please help me to get this done.<br class=""><div class=""><div class=""><br class="">y = fldmeanx<br class="">y1 = fldmeany<br class=""><br class="">;The area between b/w curves y and y1 will be filled in with grey<br class=""><br class="">res@gsnXYFillColors = "grey"<br class=""><br class="">plotxy = gsn_csm_y(wks,y,res)<br class=""><br class=""></div><div class="">below is the script and the figure <br class=""><br class=""><br class=""><br class=""><br class=""></div><div class="">;*****************************************************<br class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br class="">;*****************************************************<br class="">begin<br class="">;***************************************************** <br class="">;read in data <br class="">;***************************************************** <br class="">fx = addfile("/...../<a href="http://wah2_sas_lrbdesh.1992.nc/" target="_blank" class="">wah2_sas_LRBdesh.1992.nc</a>","r")<br class="">fy= addfile("/....../<a href="http://wah2_sas_lrbdesh.2003.nc/" target="_blank" class="">wah2_sas_LRBdesh.2003.nc</a>","r")<br class="">f0=addfile ("/../<a href="http://wah2_sas_1985_2007.part.lrbdesh.ymonmean_1_11.nc/" target="_blank" class="">wah2_sas_1985_2007.part.LRBdesh.ymonmean_1_11.nc</a>", "r");&nbsp;&nbsp;&nbsp; <br class="">f = addfile("/.../APHRO_Asian_Monsoon_1963-2007/APHRO_LRBdesh_ppt_1985_2007_ymonmean_1_11.nc", "r")<br class="">f1 = addfile(".../<a href="http://gpcc.precip.ymonmean_1_11.1985-2007.v6.360d.lrbdesh.nc/" target="_blank" class="">GPCC.precip.ymonmean_1_11.1985-2007.v6.360d.LRBdesh.nc</a>","r")<br class="">f2 = addfile("/.../<a href="http://uod.precip.360d.ymonmean.1985_2007_lrbdesh.v301.nc/" target="_blank" class="">UoD.precip.360d.ymonmean.1985_2007_LRBDesh.v301.nc</a>","r")<br class=""><br class="">;***************************************************** <br class="">; parameters<br class="">;***************************************************** <br class="">PPT_modx = fx-&gt;field90(:,0,:,:)<br class="">PPT_modx = PPT_modx*86400<br class=""><br class="">PPT_mody = fy-&gt;field90(:,0,:,:)<br class="">PPT_mody = PPT_mody*86400<br class=""><br class="">PPT_mod = f0-&gt;field90(:,0,:,:)<br class="">PPT_mod = PPT_mod*86400<br class=""><br class="">PPT_obs = f-&gt;precip<br class="">PPT_obs1 = f1-&gt;precip/30<br class="">PPT_obs2 = f2-&gt;precip/3<br class=""><br class=""><br class="">fldmeanx = wgt_areaave_Wrap(PPT_modx,1.0,1.0,1)<br class="">fldmeany = wgt_areaave_Wrap(PPT_mody,1.0,1.0,1)<br class="">fldmean0 = wgt_areaave_Wrap(PPT_mod,1.0,1.0,1)<br class="">fldmean = wgt_areaave_Wrap(PPT_obs,1.0,1.0,1)<br class="">fldmean1 = wgt_areaave_Wrap(PPT_obs1,1.0,1.0,1)<br class="">fldmean2 = wgt_areaave_Wrap(PPT_obs2,1.0,1.0,1)<br class=""><br class="">time = f0-&gt;time0<br class="">x = PPT_mod&amp;time0<br class="">timax = dimsizes(time)-1<br class=""><br class="">;--convert the time proleptic_gregorian calendar to UTC date <br class="">utc_date&nbsp;&nbsp; = cd_calendar(time,0)<br class=""><br class="">;-- set date variable names<br class=""><br class="">year&nbsp;&nbsp;&nbsp;&nbsp; = tointeger(utc_date(:,0))<br class="">month&nbsp;&nbsp;&nbsp; &nbsp;= tointeger(utc_date(:,1))<br class="">day&nbsp;&nbsp;&nbsp; &nbsp;= tointeger(utc_date(:,2))<br class="">hour &nbsp;&nbsp;&nbsp; &nbsp;= tointeger(utc_date(:,3))<br class="">minute &nbsp;&nbsp;&nbsp; &nbsp;= tointeger(utc_date(:,4))<br class="">second &nbsp;&nbsp;&nbsp; &nbsp;= utc_date(:,5)<br class=""><br class="">;-- write date as string (MM)<br class="">date_str_i = sprinti("%0.2i",month)<br class=""><br class="">;-- create the time strings, plot every axis annotation<br class="">incr&nbsp;&nbsp;&nbsp;&nbsp; = 1<br class="">labels &nbsp;&nbsp;&nbsp; &nbsp;= (/date_str_i(0::incr)/)<br class="">labels&nbsp;&nbsp; = (/"J","F","M","A","M","J","J","A","S","O","N"/)<br class=""><br class="">;-- set resources <br class="">res = True<br class="">res@trXMinF&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = time(0)&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ; time minimum on axis <br class="">res@trXMaxF&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = time(timax)&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ; time maximum on axis <br class="">res@tmXBMode &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "Explicit"&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ; explicit time setting<br class="">res@tmXBValues &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = PPT_mod&amp;time0(::incr)&nbsp; ; axis tick position<br class="">res@tmXBLabels &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = labels <br class=""><br class=""><br class="">colors = (/"grey","grey","blue","green","violet","orange"/)<br class="">lg_labels = (/"RCM","Range of","RCM","APHRODITE","GPCC","UoD"/)<br class=""><br class="">printVarSummary(time)<br class="">printVarSummary(PPT_mod)<br class="">printVarSummary(PPT_obs)<br class="">printVarSummary(PPT_obs1)<br class="">printVarSummary(PPT_obs2)<br class=""><br class="">wks = gsn_open_wks("eps","annpptcycle")&nbsp; <br class=""><br class="">res =True<br class="">res@gsnDraw&nbsp;&nbsp;&nbsp; = False<br class="">res@gsnFrame&nbsp;&nbsp; = False<br class="">res@gsnPaperOrientation = "portrait"<br class=""><br class="">res= True&nbsp;&nbsp; ; plot mods desired<br class="">res =True<br class="">res@gsnMaximize= True<br class="">res@gsnDraw&nbsp;&nbsp;&nbsp; = False<br class="">res@gsnFrame&nbsp;&nbsp; = False<br class="">res@gsnPaperOrientation = "portrait"<br class=""><br class=""><br class="">res= True&nbsp;&nbsp; ; plot mods desired<br class="">res@tiMainString = "Bangladesh with Larger Region"<br class="">res@tiYAxisString&nbsp;&nbsp; = "Precipitation (mm/day)" <br class="">res@tiXAxisString&nbsp;&nbsp; = "months" <br class="">res@xyLineThicknessF = (/6,6,8,6,6,6/)<br class="">res@trYMinF &nbsp;&nbsp;&nbsp; = 0.0<br class="">res@trYMaxF &nbsp;&nbsp;&nbsp; = 15.0<br class=""><br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(0)<br class="">plot0 = gsn_csm_xy(wks,x,fldmeanx,res)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br class="">&nbsp;&nbsp;&nbsp;&nbsp; <br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(1)<br class="">plot1 = gsn_csm_xy(wks,x,fldmeany,res)&nbsp;&nbsp;&nbsp;&nbsp; <br class=""><br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(2)<br class="">plot2 = gsn_csm_xy(wks,x,fldmean0,res)&nbsp;&nbsp; <br class=""><br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(3)<br class="">plot3 = gsn_csm_xy(wks,x,fldmean,res)&nbsp;&nbsp; <br class=""><br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(4)<br class="">plot4 = gsn_csm_xy(wks,x,fldmean1,res)&nbsp;&nbsp; <br class=""><br class="">res@xyLineColor&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = colors(5)<br class="">plot5 = gsn_csm_xy(wks,x,fldmean2,res)&nbsp;&nbsp; <br class=""><br class=""><br class="">overlay(plot0,plot1)<br class="">overlay(plot0,plot2)<br class="">overlay(plot0,plot3)<br class="">overlay(plot0,plot4)<br class="">overlay(plot0,plot5)<br class=""><br class=""><br class="">; Attach a legend<br class=""><br class="">lgres = True<br class="">lgres@lgLineColors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = colors<br class="">lgres@lgMonoItemType&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = True <br class="">lgres@lgItemType&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "Lines"&nbsp;&nbsp; <br class="">lgres@lgMonoDashIndex&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = True<br class="">lgres@lgDashIndex&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "SolidLine"&nbsp; <br class="">lgres@gsLineDashPattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0.<br class="">lgres@lgLineThicknessF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 5.<br class="">lgres@lgLabelFontHeightF &nbsp;&nbsp;&nbsp; = 0.25<br class="">lgres@lgBoxMinorExtentF&nbsp; &nbsp;&nbsp;&nbsp; = 0.25<br class="">lgres@vpWidthF&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = 0.25<br class="">lgres@vpHeightF &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = 0.25<br class="">lgres@pmLegendDisplayMode &nbsp;&nbsp;&nbsp; = "Always"<br class="">lgres@pmLegendWidthF&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = 0.9<br class="">lgres@pmLegendHeightF&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = 0.1<br class="">lgres@xyExplicitLabels &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = lg_labels<br class="">lgres@lgBoxMinorExtentF &nbsp;&nbsp;&nbsp; = 0.8<br class="">lgres@lgPerimOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False<br class="">legend = gsn_create_legend(wks, 6, lg_labels, lgres)<br class=""><br class="">amres &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = True <br class="">amres@amJust &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "BottomRight"&nbsp;&nbsp;&nbsp;&nbsp; ; Use bottom right corner of box for determining its location.<br class="">amres@amOrthogonalPosF&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = -0.12<br class="">amres@amParallelPosF &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = -0.1<br class=""><br class="">annoid&nbsp; =&nbsp; gsn_add_annotation(plot0, legend, amres)&nbsp; ; add legend to plot <br class=""><br class="">draw(plot0)<br class=""><br class="">frame(wks)<br class=""><br class="">end<br class=""><br class=""><br class=""><br class=""><span id="cid:ii_152d1623a3edeb6d">&lt;image.jpeg&gt;</span><br class=""><br class=""><br class=""></div></div></div>
</div><br class=""></div></div></div></div></div></div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></body></html>