function fn_mseriesgraph(ydate,keyindx,rnum,cnum,q_m,xlab,ylab,tlab) % fn_mseriesgraph(ydate,keyindx,rnum,cnum,q_m,xlab,ylab,tlab) % Graph actual series or point forecasts or both (annual or monthly or quarterly) % with multiple series in one subplot. % % ydate: T-by-n+2-by-h series data with dates in the first 2 columns in the order of year and month (or quarter). % T: the length of an individual series. % n+2: n series plus the first 2 columns indicating dates. % h: the number of sereies on the 3rd dimension, put in the same subplot as in each of the n series. % Thus, the first 2 columns in the 3rd dimension can be NaN while % some elements are also allowed to be NaN if no data are available. % keyindx: index for the variables to be graphed % rnum: number of rows in subplot % cnum: number of columns in subplot % q_m: if 4 or 12, quarterly or monthly data % xlab: 1-by-1 x-axis label for what conditions imposed; e.g., conlab = 'All bar MS shocks inspl' % ylab: string array for the length(keyindx)-by-1 variables % tlab: 1-by-1 title label for (e.g., as of time of forecast) %------------- % No output argument for this graph file % See fn_foregraph.m, fn_forerrgraph.m. % % Tao Zha, September 2000 vyrs = ydate(:,1); % vector column hornum = cell(length(vyrs),1); % horizontal year (number) count=0; for k=vyrs' count=count+1; jnk=num2str(k); if length(jnk)==4 % years hornum{count}=jnk(3:4); % e.g., with '1990', we have '90' else hornum{count}=jnk; % e.g., with '1', '2', ... end end if rnum*cnum=length(keyindx) %i>=length(keyindx)-1 xlabel(xlab) end % grid ylabel(char(ylab(i))) end