begin ;---Read netCDF file in = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r") u = in->U(0,:,:) ;---Start the graphics. wks = gsn_open_wks("png","datagrid") ; send graphics to PNG file res = True ; plot mods desired res@gsnMaximize = True ; maximize plot size res@gsnDraw = False ; don't draw yet res@gsnFrame = False ; don't advance frame res@cnFillOn = True res@cnLinesOn = False res@cnFillOpacityF = 0.5 res@cnFillPalette = "BlueWhiteOrangeRed" map = gsn_csm_contour_map(wks,u,res) ;---------------------------------------------------------------------- ; gsn_coordinates will examine "u" to see if it has lat/lon coordinate ; arrays (which it does in this case). These will be used to ; draw the lat/lon lines. ;---------------------------------------------------------------------- pres = True pres@gsnCoordsAttach = True ; attach the coordinates rather than drawing them instantly ;---Add lines at every grid point pres@gsnCoordsAsLines = True gsn_coordinates(wks,map,u,pres) ;---Add dots at every third value (shifted by 1) pres@gsnCoordsAsLines = False ; Go back to markers pres@gsMarkerIndex = 4 ; hollow circle pres@gsMarkerSizeF = 7 pres@gsMarkerColor = "Black" gsn_coordinates(wks,map,u(1::3,1::3),pres) ;---Add dots at every third value (shifted by 1) pres@gsMarkerSizeF = 5 pres@gsMarkerIndex = 16 ; filled dot pres@gsMarkerColor = "yellow" gsn_coordinates(wks,map,u(1::3,1::3),pres) ;---Add circles at every third value pres@gsMarkerIndex = 15 ; hollow circle with dot in middle pres@gsMarkerColor = "Black" gsn_coordinates(wks,map,u(::3,::3),pres) ;---Drawing the map will draw all the added stuff, which is going to be a busy plot! draw(map) frame(wks) end