function [stats]=f_Tmodes(fn, T, N, idx, M, myrs, ND, ttxt) %* plot temperature data and climate mode index % % fn figure number % T temperature record to plot % N column number to plot % idx mode index % M column number to plot % myrs [2 x 1] containing start and end years for average % ND no data value % ttxt title text, a string of characters % % T_records.mat data are from the GISTEMP archive % % T_* each temperature record contains 18 columns, temps in deg C % (:,1) year % (:,2:13) monthly means, Jan, Feb, etc. % (:,14) D-J-F mean % (:,15) M-A-M mean % (:,16) J-J-A mean % (:,17) S-O-N mean % (:,18) annual mean % % modeindex_records.mat data are from the NOAA Climate Prediction Center % % AAOindex 32x13 Antarctic, the southern annular mode % AOindex 61x13 Arctic, the northern annular mode % (:,1) year % (:,2:13) monthly means % (:,14) winter mean, first year is J-F mean %* use function to compute anomaly and trend [anom, fep, stats]=f_Tanom(T(:,1), T(:,N), [1951 1980]); figure(fn) clf [AX,H1,H2] = plotyy(T(:,1), anom, idx(:,1), idx(:,M)); set(get(AX(1),'Ylabel'),'String','temperature anomaly (C)') set(get(AX(2),'Ylabel'),'String','mode index') set(AX(1), 'YColor','r', 'XLim', [min(T(:,1)) max(T(:,1))]) set(AX(2), 'YColor','b','XLim', [min(T(:,1)) max(T(:,1))]) set(H1,'Color','r','marker','.') set(H2,'Color','b', 'marker','.') title(ttxt) xlabel('year')