load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin filename = "Fire.nc" a = addfile(filename,"r") ; ; Assuming "TDim" length is a multiple of twelve, so ; we can divide by this to get the # of years. ; nyears = getfilevardimsizes(a,"TDim")/12 mp = reshape(a->MeanPower,(/nyears,12/)) copy_VarAtts(a->MeanPower,mp) months = ispan(1,12,1) ; for labels later month_names = month_name(0) ; "Jan", "Feb", etc ;---Start the graphics colors = (/"blue","black","forestgreen","purple","cyan","orange","brown"/) wtype = "png" wtype@wkWidth = 1000 ; size of png in pixels wtype@wkHeight = 1000 ; 1000x1000 wks = gsn_open_wks(wtype,"fire") res = True res@gsnMaximize = True ; maximize plot in frame res@vpWidthF = 0.8 ; change shape of plot res@vpHeightF = 0.5 res@xyDashPattern = 0 ; set to solid for all curves res@xyLineColors = colors res@xyLineThicknessF = 4.0 res@tiMainString = filename + " (using dummy years)" res@tiYAxisString = mp@long_name + " (" + mp@units + ")" res@tiYAxisFontHeightF = 0.02 res@tiMainFontHeightF = 0.02 ;---Tickmarks and their labels res@tmYROn = False res@tmYLFormat = "f" ; Remove trailing zeros from labels res@tmXBMode = "Explicit" res@tmXBValues = ispan(1,12,1) res@tmXBLabels = month_names res@tmXBMajorOutwardLengthF = 0.0 res@tmXBMajorLengthF = 0.0 res@tmXUseBottom = False res@tmXTMajorLengthF = 0.01 res@tmXTMajorOutwardLengthF = 0.0 res@tmXTMinorOutwardLengthF = 0.0 res@tmXTMinorLengthF = 0.0 res@tmYLMajorLengthF = 0.01 res@tmYLMajorOutwardLengthF = 0.0 res@tmYLMinorOutwardLengthF = 0.0 res@tmYLMinorLengthF = 0.0 res@tmXBLabelFontHeightF = 0.015 res@tmYLLabelFontHeightF = 0.015 ;---Legend resources res@pmLegendDisplayMode = "Always" ; turn on legend res@lgJustification = "TopRight" res@pmLegendOrthogonalPosF = -1.13 ; move into plot res@pmLegendParallelPosF = 0.99 res@pmLegendWidthF = 0.1 ; change size res@pmLegendHeightF = 0.38 res@lgBoxMinorExtentF = 0.3 ; shorten legend lines res@lgLabelFontHeightF = 0.015 res@xyExplicitLegendLabels = " " + ispan(2000,2014,1) res@trYMinF = min(mp) res@trXMinF = 0.9 ; add small margins res@trXMaxF = 12.1 ; around X axis plot = gsn_csm_xy(wks,months,mp,res) end