Re: gsn_polymarker and gsn_text

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 19 2012 - 10:20:23 MDT

Hi Luis,
This sounds like you have a draw/frame issue. draw and frame must be
called after gsn_text or gsn_polymarker are used, and, you must tell the
plotting function to not draw the plots and to not advance the frame.
(This should probably be explicitly stated in the gsn_text /
gsn_polymarker documentation.. Note though that the examples do show
this being done.)
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_text.shtml
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_polymarker.shtml

According to the wrf_map_overlays documentation, the easiest way to tell
wrf_map_overlays to not draw the plots/advance the frame is to set
pltres@PanelPlot = True
http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml

So your coding should look like this:

pltres@PanelPlot = True

plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot field over map

; Add marks where the stations are located
   resp = True ; Poly res desired
   resp@gsMarkerColor = "Black"
   resp@gsMarkerIndex = 16 ; black dot
   resp@gsMarkerSizeF = 0.01
   gsn_polymarker(wks,plot,-14.012,28.432,resp) ; Molino de Antigua, GC08

; Add the name of the station
   txres = True ; text mods desired
   txres@txFontHeightF = 0.015 ; text font height
   gsn_text(wks,plot,"Antigua",-14.012,28.472,txres)

   draw(plot)
   frame(wks)

If that coding doesn't work please let ncl-talk know.
Adam

On 03/19/2012 08:18 AM, Luis C. Cana Cascallar wrote:
> Hi all,
>
> I'm trying to create one single frame that includes a contour -terrain heights- drawn over a map, but I also would like to include the location of one ground station and its name if possible in the same plot, same frame.
> In oder to create the contour and the map I started with the NCL WRF example "wrf_wps_ter6.ncl", which first creates the contour and then overlays it over the map, using wrf_map_overlays. This part works ok; now, I added the following code to get the polymarker and the text drawn over the plot:
>
> plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot field over map
>
> ; Add marks where the stations are located
> resp = True ; Poly res desired
> resp@gsMarkerColor = "Black"
> resp@gsMarkerIndex = 16 ; black dot
> resp@gsMarkerSizeF = 0.01
> gsn_polymarker(wks,plot,-14.012,28.432,resp) ; Molino de Antigua, GC08
>
> ; Add the name of the station
> txres = True ; text mods desired
> txres@txFontHeightF = 0.015 ; text font height
> gsn_text(wks,plot,"Antigua",-14.012,28.472,txres)
>
>
>
> However, what I see is the plot without the polymarker and the text, and when I advance the frame, the black dot seems to appear in the right place but for a very little moment
>
> What am I doing wrong? I've read that gsn_polymarker and gsn_text should be used with only with gsn functions and wrf_contour or wrf_map_overlays are not...
>
> Thanks in advance,
>
> Luis
>
> Luis C. Cana Cascallar
> lcana@dfis.ulpgc.es
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 19 10:20:33 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 20 2012 - 15:27:15 MDT