[ncl-talk] Filling area between curve and x-axis in xy2 plot

Guido Cioni guidocioni at gmail.com
Wed May 25 14:26:21 MDT 2016


I already thought of swapping the axes. That made the trick indeed, although I would have preferred to keep fluxes axis on the left and Qnet on the right. 
Thank you!

P.S. Any plans about controlling the Draw Order in xy2 plots in the future? 

Guido Cioni
http://guidocioni.altervista.org <http://guidocioni.altervista.org/> 




> Il giorno 25 mag 2016, alle ore 22:13, Adam Phillips <asphilli at ucar.edu> ha scritto:
> 
> Hi Guido,
> I tested your code here and am seeing what you are seeing. I did get it to work though by changing the order of the plots in gsn_csm_xy2. So, try changing this:
> plot(j)=gsn_csm_xy2(wks,time,data,data2,res,res2)
> to this:
> plot(j)=gsn_csm_xy2(wks,time,data2,data,res2,res)
> Let ncl-talk know if that does not work for you. 
> Adam
> 
> On Wed, May 25, 2016 at 3:19 AM, Guido Cioni <guidocioni at gmail.com <mailto:guidocioni at gmail.com>> wrote:
> Dear all,
> I’ve been trying to produce a simple xy2 plot with two lines and a filled curve. The problem is that the latter, which is drawn together with the curve in the second y axis, cover the other two lines. I tried to play around with the resources xyCurveDrawOrder and tfPolyDrawOrder but nothing did the trick. I think that there is no special resource that controls the draw order of elements in xy2 plots, thus the second curve is always drawn on top of the others. 
> Is there any other way to achieve the same results? Maybe using polyline? 
> Attached you find a snippet of the code (only the relevant part) and the resulting plot. 
> 
>  do j=0,dimsizes(case)-1
>    
>  plot=new(dimsizes(case), graphic)
>  poly=new(dimsizes(case), graphic)
>  wks   = gsn_open_wks ("pdf",”tserie")                ; open workstation
>  res                  = True                     ; plot mods desired
>  res at xyDashPatterns=(/0,0/)
>  res at xyLineThicknessF=(/3,3/)
>  res at xyLineColors=(/"blue","red”/)
> 
>    data= (/lhflx, shflx/)
>    data2 = qnet
> 
>    res2= True
>    res2 at gsnDraw = False
>    res2 at gsnFrame = False
>    res2 at xyLineColor = "gold"
>    res2 at gsnYRefLine           = 0.0
>   res2 at gsnAboveYRefLineColor = “lightyellow"
>    
>   plot(j)=gsn_csm_xy2(wks,time,data,data2,res,res2)
>   
> delete([/lhflx, shflx, serie, time, data /])
>  end do
> 
> plnres = True
> gsn_panel(wks,plot,(/3,1/),plnres)
> 
> 
> Guido Cioni
> http://guidocioni.altervista.org <http://guidocioni.altervista.org/> 
> 
> 
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
> 
> 
> 
> 
> -- 
> Adam Phillips 
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/ <http://www.cgd.ucar.edu/staff/asphilli/>   303-497-1726
> 
>  <http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160525/8f7b98f5/attachment.html 


More information about the ncl-talk mailing list