[ncl-talk] polygon now showing up in the polar plot
Ipshita Majhi
ipmajhi at alaska.edu
Fri Oct 3 14:13:03 MDT 2014
Dear All,
I am trying to plot a polygon on a polar plot but it is not showing up
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************************
begin
;************************************************
; read in netCDF file and access data
a =addfile("~/Documents/Snow_cover_IMS/nhsce_v01r01_19661004_20140602.nc
","r");
sce=a->snow_cover_extent(0,:,:)
lat=a->latitude
lon=a->longitude
sce at lat2d=lat
sce at lon2d=lon
;
;************************************************
; create polygon (remember the earth is a sphere)
;************************************************
xpt = new(20,float)
ypt = new(20,float)
xpt(0:9) = fspan(120,-120,10) ; lon around edge
xpt(10:14) = -180 ; up 240
xpt(15:19) = 120 ; down 120
ypt(0:9) = 40 ; lat around edge
ypt(10:14) = fspan(40.,90.,5) ; lat up to pole
ypt(15:19) = fspan(90.,40.,5) ; lat down from pole
;************************************************
; create plots
;************************************************
wks = gsn_open_wks("ps" ,"sce_polar_polygon") ; create ps
plot
res = True ; plot mods desired
res at gsnPolar = "NH" ; specify the hemisphere
plot = gsn_csm_contour_map_polar(wks,sce,res) ; create the plot
dum1 = gsn_add_polygon(wks,plot,xpt,ypt,False) ; add polygon
end
;***********************************************
Best Regards
Ipshita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141003/598870cf/attachment.html
More information about the ncl-talk
mailing list