[ncl-talk] Filling area between curve and x-axis in xy2 plot
Guido Cioni
guidocioni at gmail.com
Wed May 25 03:19:40 MDT 2016
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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160525/839cb2b2/attachment-0002.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tserie_test_23_july.pdf
Type: application/pdf
Size: 229823 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160525/839cb2b2/attachment-0001.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160525/839cb2b2/attachment-0003.html
More information about the ncl-talk
mailing list