;---------------------------------------------------------------------- ; 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. ;---------------------------------------------------------------------- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ;---Read data a = addfile("file.nc","r") x = a->x ;---Open workstation and change color map wks = gsn_open_wks("x11","contour") ; "ps", "pdf", "png" gsn_define_colormap(wks,"amwg") ;---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@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off line labels ;---These two resources are not needed in V6.1.0 res@gsnSpreadColors = True ; span full color map res@lbLabelAutoStride = True ; nice spacing for labelbar 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 = "This is a main title" contour = gsn_csm_contour(wks,x,res) end