load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ; ; The poly1* series of examples shows how to add various annotations ; to a plot, like markers, text, polygons, and lines. There are ; two different data spaces you can use for adding this stuff: NDC ; space, or data space. Both will be shown. ; begin wks = gsn_open_wks("ps","poly1e") ; Open PS file "poly1e.ps" mpres = True ; Variable for map resources. mpres@gsnDraw = False ; Don't draw plot yet mpres@gsnFrame = False ; Don't advance the frame mpres@mpMinLatF = 25. ; Zoom in on United States mpres@mpMaxLatF = 50. mpres@mpMinLonF = 235. mpres@mpMaxLonF = 290. mpres@mpLandFillColor = 11 ; Yellowish mpres@tiMainString = "Ugly map" ; Main title map = gsn_csm_map(wks,mpres) ; Create plot, but don't draw it. ; ; Add a marker to the plot, using the lat/lon data space of the map. ; gsres = True ; "Graphic Style" resources gsres@gsMarkerColor = "NavyBlue" ; Marker color gsres@gsMarkerIndex = 15 ; Marker style gsres@gsMarkerSizeF = 30.0 ; Marker size gsres@gsMarkerThicknessF = 3.0 ; Marker thickness dum1 = gsn_add_polymarker(wks,map,-110,40,gsres) ; ; Add polyline to the plot, again using lat/lon data space. ; You can use the same "gsres" resource list, because the "GraphicStyle" ; resources apply to polylines, polymarkers, and polygons. ; gsres@gsLineColor = "OliveDrab" ; Line color gsres@gsLineThicknessF = 3.0 ; Line thickness dum2 = gsn_add_polyline(wks,map,(/256,270,270,256,256/), \ (/ 30, 30, 36, 36, 30/), gsres) draw(map) ; Drawing map will draw "added" features. frame(wks) ; Advance frame end