[ncl-talk] Add polyline-Add_text to contour terrain height plot?

Sebastian Otarola-Bustos Sebastian.F.Otarola-Bustos.1 at nd.edu
Wed Apr 29 19:21:21 MDT 2015


Hi all,

I'm trying to add the location of a city and it's name in the same plot of
a contour-terrain heights drawn over a map.

I'm editing the  *wrf_wps_ter6.ncl *example script. And it works fine
plotting the map and the topography, but it doesn't shows me the polymarker
and the name of the city.

If someone see my mistake, I would really aprecciate his help.

Best regards,
Sebastián.


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT*/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"*
> begin
>  a=addfile("/afs/
> crc.nd.edu/user/s/sotarola/WRF/Santiago/Sim/1/geo_em.d01.nc","r")
>
>   type = "pdf"
>   wks = gsn_open_wks(type,"Norte")         ; Create a plot workstation
>
>   opts = True                                  ; Set some Basic Plot
> options
>   opts at MainTitle = "GEOGRID FIELDS"
>   opts at InitTime = False                        ; Do not plot time or
> footers
>   opts at Footer = False
>   ter = wrf_user_getvar(a,"HGT_M",0)           ; Read the variable to
> memory
>   lat  = wrf_user_getvar(a,"lat",-1)
>   lon  = wrf_user_getvar(a,"lon",-1)
>   opt = True
>   loc1 = wrf_user_ll_to_ij(a,-70.63929,-33.35079,opt)  ; Chanaral
>   loc1 = loc1-1;
>   res = opts
>  res at cnFillOn = True                          ; Create a color fill plot
>   res at ContourParameters = (/ 0., 5000., 50. /) ; Set the levels
>
>   contour = wrf_contour(a,wks,ter,res)
>   pltres = True
>   pltres at PanelPlot = True                             ; Set plot options
>   mpres = True                                 ; Set map options
>   mpres at mpGeophysicalLineColor      = "Black"  ; Overwrite basic map
> settings
>   mpres at mpGridLineColor             = "Black"
>   mpres at mpLimbLineColor             = "Black"
>   mpres at mpNationalLineColor         = "Black"
>   mpres at mpPerimLineColor            = "Black"
>   mpres at mpUSStateLineColor          = "Black"
>   mpres at gsnDraw = False
>   mpres at gsnFrame =False
>   plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot field
> over map background
>  ; Poly res desired
>   resp = True
>   resp at gsMarkerColor = "Black"
>   resp at gsMarkerIndex = 16 ; black dot
>   resp at gsMarkerSizeF = 0.01
>
> gsn_polymarker(wks,plot,lon(0,loc1(1),loc1(0)),lat(0,loc1(1),loc1(0)),resp)
> ;
> ; Add the name of the station
>    txres= True
>    txres at txFontHeightF = 0.015 ; text font height
>
>  gsn_text(wks,plot,"Chanaral",lon(0,loc1(1),loc1(0)),lat(0,loc1(1),loc1(0)),txres)
>    draw(plot)
>    frame(wks)
> end
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150429/e36372d1/attachment.html 


More information about the ncl-talk mailing list