[ncl-talk] gsn_polyline and shading issue

Kyle Griffin ksgriffin2 at wisc.edu
Mon Aug 4 14:43:07 MDT 2014


I believe the quick fix, assuming nothing else is explicitly ordered, will
be

res at mpDrawOrder = "PreDraw"

If that doesn't do it, you can poke around with other DrawOrder resources
to move things into either "PreDraw", "Draw", or "PostDraw" drawing phases.


Kyle

----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
Room 1421
1225 W Dayton St, Madison, WI 53706
Email: ksgriffin2 at wisc.edu


On Mon, Aug 4, 2014 at 3:28 PM, Cathy Smith (NOAA Affiliate) <
cathy.smith at noaa.gov> wrote:

> 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
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140804/32e24ada/attachment.html 


More information about the ncl-talk mailing list