load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl" begin filename = "ts_Amon_CESM1-CAM5_historical_r1i1p1_185001-200512.nc" a = addfile(filename,"r") temp = a->ts tavg = dim_avg_Wrap(temp) ; average across longitude tavg = tavg-273.15 ; convert from Kelvin->Celsius tavg@units = "degC" lat = 0. ; which latitude to plot wks = gsn_open_wks("png","time1d") res = True res@gsnMaximize = True res@vpWidthF = 0.9 res@vpHeightF = 0.3 res@trXMaxF = max(tavg&time) res@tiMainString = "Average " + tavg@long_name + " (" + \ tavg@units + ") at lat = " + lat res@tiMainFontHeightF = 0.02 res@tiYAxisString = "" ;---Add nice time labels on X axis rest = True rest@ttmFormat = "%c %Y" rest@ttmNumTicks = 10 time_axis_labels(tavg&time,res,rest) res@tmXBLabelFontHeightF = 0.01 plot = gsn_csm_xy(wks,tavg&time,tavg(:,{lat}),res) end