[ncl-talk] polygon now showing up in the polar plot

Xin Xi xin.xi30 at gmail.com
Fri Oct 3 14:22:49 MDT 2014


this is a draw order issue.
set at the beginning:
res at gsnDraw = False
then
plot =gsn_csm_contour_map(...)
draw(plot)
dum1=gsn_add_polygon(...)

On Friday, October 3, 2014, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

> 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
>


-- 
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141003/b34d392b/attachment.html 


More information about the ncl-talk mailing list