[ncl-talk] Add polyline-Add_text to contour terrain height plot?
Sebastian Otarola-Bustos
Sebastian.F.Otarola-Bustos.1 at nd.edu
Thu Apr 30 09:09:59 MDT 2015
It worked perfect,
Thank you very much Alexander!
Kind regards,
Sebastián.
On Wed, Apr 29, 2015 at 10:33 PM, Alexander Schaefer <
alexander.schaefer at mines.sdsmt.edu> wrote:
> Sebastian,
>
> Try adding pltres at FramePlot = False
>
> I think it is still framing the plot before you add the annotations,
> gsnDraw and gsnFrame are more related to the plot than the map. See the
> link below for where the information comes from. I think this is the only
> change you need in your script.
>
> https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml
>
>
> Hope that helps,
> -Alex
>
>
>
>
>
> On Apr 29, 2015, at 7:21 PM, Sebastian Otarola-Bustos <
> Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:
>
>
> 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
>>
>
> _______________________________________________
> 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/20150430/b50cca0d/attachment.html
More information about the ncl-talk
mailing list