; ; 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("png","poly1f") ; Open png file "poly1f.png" gsn_define_colormap(wks,"uniform") ; Color map w/lots of colors mpres = True ; Plot options desired. mpres@gsnDraw = False ; Don't draw plot yet mpres@gsnFrame = False ; Don't advance the frame mpres@mpProjection = "Orthographic" mpres@mpEllipticalBoundary = True mpres@mpCenterLatF = 20.0 mpres@mpCenterLonF = 14.0 mpres@mpLandFillColor = 52 ; a brownish color mpres@mpLimitMode = "LatLon" mpres@mpMinLatF = -40 mpres@mpMaxLatF = 42 mpres@mpMinLonF = -20 mpres@mpMaxLonF = 60 mpres@tiMainString = "Orthographic projection" ; Main title map = gsn_csm_map(wks,mpres) ; Draw plot ; ; Add a marker to the plot at the position of Lake Chad, using ; the lat/lon data space of the map (lon = 14, lat = 13). ; gsres = True ; "Graphic Style" resources gsres@gsMarkerColor = "NavyBlue" ; Marker color gsres@gsMarkerIndex = 15 ; Marker style gsres@gsMarkerSizeF = 0.03 ; Marker size gsres@gsMarkerThicknessF = 3.0 ; Marker thickness dum1 = gsn_add_polymarker(wks,map,14,13,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 = "CadetBlue1" ; Line color gsres@gsLineThicknessF = 3.0 ; Line thickness dum2 = gsn_add_polyline(wks,map,(/ 27, 37, 37, 27, 27/), \ (/-15, -15, 2, 2, -15/), gsres) draw(map) ; If gsnDraw is False, then here's how you draw plot. frame(wks) ; If gsnFrame is False, then here's how you advance frame. end