[ncl-talk] gsn_polyline and shading issue

Cathy Smith (NOAA Affiliate) cathy.smith at noaa.gov
Mon Aug 4 14:28:00 MDT 2014


Hi NCLers
I'm having trouble getting a polyline to appear OVER a map with
continents shaded. I have simplified code below which reproduces the
problem.  The code draws a basic map (shading is default) and then a box
on the map using gsn_polyline . You can run code and then look at
fluffy.ps. The box just shows up where there is no shading. I verified
in testing that the lines show up as long as they aren't located where
the shading is. How can I control the order of shading so it is done
before the polylines?

NCL version is 6.2.0 on a 64 bit linux server.

Thanks!
Cathy Smith


;*;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;**************************************************
begin

   psname="fluffy"
   wks = gsn_open_wks("ps",psname)               ; open workstation
   res            = True                          ; map resources
   res at gsnDraw    = False                         ; don't draw
   res at gsnFrame   = False                         ; don't advance frame
   res_lb         = True                          ; map resources
   latmin=41
   latmax=52
   lonmin=235
   lonmax=250
   poly_lat1=43
   poly_lat2=50
   poly_lon1=237
   poly_lon2=247
   res at mpMaxLatF  = latmax                           ; select subregion
   res at mpMinLatF  = latmin
   res at mpMinLonF  = lonmin
   res at mpMaxLonF  = lonmax
   res at mpCenterLonF  = (lonmax+lonmin)/2.

   map = gsn_csm_map_ce(wks,res)                         ; create map

   pres                  = True                             ; polyline
resources
   pres at gsLineThicknessF = 2.0                ; line thickness

 
gsn_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat1,poly_lat1/),pres)
 
gsn_polyline(wks,map,(/poly_lon2,poly_lon2/),(/poly_lat1,poly_lat2/),pres)
 
gsn_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat2,poly_lat2/),pres)
 
gsn_polyline(wks,map,(/poly_lon1,poly_lon1/),(/poly_lat1,poly_lat2/),pres)

   draw(map)                                          
;   frame(wks)                                        

end

-- 
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
http://www.esrl.noaa.gov/psd/people/cathy.smith/

Emails about data/webpages may get quicker responses from emailing 
esrl.psd.data at noaa.gov



More information about the ncl-talk mailing list