Re: polygon in a XY plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon, 16 Apr 2007 14:23:54 -0600

Hi Mateus,

You can set the resource xyCurveDrawOrder = "PostDraw" to tell NCL to
draw the xy curve last.

http://www.ncl.ucar.edu/Document/Graphics/Resources/xy.shtml#xyCurveDrawOrder
Good luck,
Adam

Mateus da Silva Teixeira wrote:
> Dear NCL users,
>
> I'm trying to add a polygon to a XY plot to enhance a specific region of
> the plot. However, when I use gsn_add_polygon, the polygon hides the XY
> graph. I only could draw this graph with gsn_polygon. But, gsn_polygon
> isn't appropriated for multi panels plot, so I would like to make these
> plots with gsn_add_polygon.
>
> Please, see the script below for an example:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
> y = (/1,2,3,4,5,5,6,5,4,3,2,1,0,-1,-2,3/)
> x = ispan(1,16,1)
>
> ypol = (/-2,-2,6,6/)
> xpol = (/1,16,16,1/)
>
> wks = gsn_open_wks("ps","testXY")
>
> xyRes = True
> xyRes_at_gsnFrame = False
> xyRes_at_gsnDraw = False
>
> poliRes = True
> poliRes_at_gsFillColor = "gray"
>
> plot = gsn_xy(wks,x,y,xyRes) gsn_polygon(wks,plot,xpol,ypol,poliRes)
> draw(plot)
> frame(wks)
>
> plot1 = gsn_xy(wks,x,y,xyRes)
> plotPoli = gsn_add_polygon(wks,plot1,xpol,ypol,poliRes)
> draw(plot1)
> frame(wks)
> end
>
> Can you help me?
>
> Thanks
> Mateus.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 16 2007 - 14:23:54 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 17 2007 - 15:41:32 MDT