[ncl-talk] gsn_add_polyline and wrf_map_overlays

Mary Haley haley at ucar.edu
Fri Mar 3 12:35:26 MST 2017


Hi Ryan,

The thing to remember about any of the gsn_add_polyxxxx or gsn_add_text
functions is they actually *attach* the requested feature to the plot, but
nothing is drawn at that point.  You have to call "draw(plot)" afterwards
in order to see the plot with the added "stuff".

This is different than gsn_polyxxxx and gsn_text, where it simply draws
this stuff immediately.

This part of your code:

draw(plot)

; Construct a polyline to show cross-section location



  pltres                 = True
  pltres at gsFillColor     = "black"
  pltres at cnLineDrawOrder      = "Draw"
  pltres at gsLineThicknessF     = 10.0

  lat = (/44.4,  42.9/)
  lon = (/-71.3, -69.3/)
  dum = gsn_add_polyline(wks,plot,lon,lat,pltres)

; draw(plot)


  frame(wks)           ;;--- closes wks AFTER adding the polyline to your
plot! // KS


needs to be changed to:

; Construct a polyline to show cross-section location



  pltres                 = True
  pltres at gsFillColor     = "black"
  pltres at cnLineDrawOrder      = "Draw"
  pltres at gsLineThicknessF     = 10.0

  lat = (/44.4,  42.9/)
  lon = (/-71.3, -69.3/)
  dum = gsn_add_polyline(wks,plot,lon,lat,pltres)

  draw(plot)           ;;-- this will draw the attached polyline.


  frame(wks)           ;;--- closes wks AFTER adding the polyline to your
plot! // KS

You can run the attached polystuff.ncl script to see the difference between
the two types of functions.

--Mary


On Fri, Mar 3, 2017 at 9:55 AM, Ryan Connelly <rconne01 at gmail.com> wrote:

> Hi,
>
> I've been able to add a polyline to a contour plot of non-WRF data, but it
> seems the switch from using gsn_csm_contour to wrf_map_overlays creates a
> problem, resulting in either two plots (one contour plot and one blank plot
> with my polyline on it), or one plot with either the contour data OR the
> polyline, but never both.
>
> I've tried moving the call to draw(plot) around, adding and taking away
> some res's, etc., but can't figure out how to make a contour plot with a
> polyline on top of it.
>
> The script is attached, in "as is" condition.
>
> Thanks,
> Ryan
>
> --
> Ryan Connelly
> M.S. Student in Atmospheric Sciences, Stony Brook University
> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
> University
> rconne01 at gmail.com
> ryan.connelly at stonybrook.edu
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20170303/187ec98d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polystuff.ncl
Type: application/octet-stream
Size: 2344 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170303/187ec98d/attachment.obj 


More information about the ncl-talk mailing list