Re: XY Plots over a Map

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 09 2012 - 12:55:54 MDT

Hi Soumik,
Yes. You can do this by manually overlaying, setting gsnFrame = False,
and by using the various vp resources.
Something like this:

wks = gsn_open_wks("ps","test")

res = True ; spatial plot resource list
res@mpMinLatF = 10.
res@mpMaxLatF = 75.
res@mpMinLonF = -170
res@mpMaxLonF = -45
res@mpCenterLonF = (/res@mpMinLonF+res@mpMaxLonF)/2
.....
res@gsnFrame = False ; do not advance the frame, as we wish to
manually overlay xy plots onto page
plot = gsn_csm_contour_map(wks,data,res)

res2 = True ; xy resource list
res2@vpXF = 0.2 ; placement of left border of xy plot along x-axis
of page in NDC units (0->1)
res2@vpYF = 0.8 ; placement of top border of xy plot along y-axis of
page in NDC units (0->1)
res2@vpWidthF = 0.2 ; width of XY plot in NDC units (0->1)
res2@vpHeightF = 0.2 ; height of XY plot in NDC units (0->1)
....
res2@gsnFrame = False ; do not advance the frame
plot2 = gsn_csm_xy(wks,val,pdf0,res2)

res2@vpXF = 0.35
res2@vpYF = 0.6
plot2 = gsn_csm_xy(wks,val,pdf1,res2)
drawNDCGrid(wks) ; draw the NDC grid in the background so you can
better choose your settings for vpXF/vpYF
frame(wks) ; advance the frame

See the vp resources here:
http://www.ncl.ucar.edu/Document/Graphics/Resources/vp.shtml
and the drawNDCGrid documentation here:
http://www.ncl.ucar.edu/Document/Functions/Shea_util/drawNDCGrid.shtml

Good luck,
Adam

On 10/09/2012 12:17 PM, Soumik Basu wrote:
> Hi,
>
> I have XY plots of PDF of 6 variable for four different regions of
> North America. I want to put these XY plots on the top of a map over
> their corresponding regions ( six XY plots per region). Is it possible
> to do so in NCL?
>
> Thanks,
> Soumik
>

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 9 12:56:04 2012

This archive was generated by hypermail 2.1.8 : Fri Oct 12 2012 - 15:38:19 MDT