;---------------------------------------------------------------------- ; This is a basic NCL template for creating contour plots. ; ; Use "contour_map_template.ncl" if you need to put the ; contours over a map. ;---------------------------------------------------------------------- ; Note: as of NCL V6.2.0, you don't need these load commands load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ;---Read data filename = "file.nc" a = addfile(filename,"r") x = a->x ;---Open workstation wks = gsn_open_wks("x11","contour") ; "ps", "pdf", "png" ;---Set some resources res = True res@gsnMaximize = True ; maximize plot in frame ;---These are sample resources you might want to set res@cnFillOn = True ; turn on contour fill res@cnFillPalette = "amwg" ; define color map for contours res@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off line labels ;---Uncomment if you want to change the contour levels ; mnmxint = nice_mnmxintvl( min(x), max(x), 18, False) ; res@cnLevelSelectionMode = "ManualLevels" ; res@cnMinLevelValF = mnmxint(0) ; res@cnMaxLevelValF = mnmxint(1) ; res@cnLevelSpacingF = mnmxint(2) res@tiMainString = "Data file is " + filename contour = gsn_csm_contour(wks,x,res) end