Debian Codegraph @

contrib/ms-sbvar/TZcode/MatlabFiles/fn_gyrfore.m

raw
1 function fn_gyrfore(yfore,yacte,keyindx,rnum,cnum,ylab,forelabel,conlab)
2 %
3 % Graph annual (or calendar year) forecasts vs actual (all data from "msstart.m")
4 %
5 % yfore: actual and forecast annual growth data with dates.
6 % yacte: actual annual growth data with dates.
7 % keyindx: index for the variables to be graphed
8 % rnum: number of rows in subplot
9 % cnum: number of columns in subplot
10 % ylab: label for the variables
11 % forelabel: title label for as of time of forecast
12 % conlab: label for what conditions imposed; e.g., conlab = 'All bar MS shocks inspl'
13 %-------------
14 % No output argument for this graph file
15 %
16 % Tao Zha, March 2000
17 %
18 % Copyright (C) 1997-2012 Tao Zha
19 %
20 % This free software: you can redistribute it and/or modify
21 % it under the terms of the GNU General Public License as published by
22 % the Free Software Foundation, either version 3 of the License, or
23 % (at your option) any later version.
24 %
25 % It is distributed in the hope that it will be useful,
26 % but WITHOUT ANY WARRANTY; without even the implied warranty of
27 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 % GNU General Public License for more details.
29 %
30 % If you did not received a copy of the GNU General Public License
31 % with this software, see <http://www.gnu.org/licenses/>.
32 %
33
34
35 vyrs = yfore(:,1);
36 hornum = cell(length(vyrs),1); % horizontal year (number)
37 count=0;
38 for k=vyrs'
39 count=count+1;
40 jnk=num2str(k);
41 hornum{count}=jnk(3:4); % e.g., with '1990', we have '90'
42 end
43
44 count=0;
45 for i = keyindx
46 count = count+1;
47 subplot(rnum,cnum,count)
48 %
49 plot(yacte(:,1),yacte(:,2+i),vyrs,yfore(:,2+i),'--')
50 set(gca,'XLim',[vyrs(1) vyrs(end)])
51 set(gca,'XTick',vyrs)
52 set(gca,'XTickLabel',char(hornum))
53 if i==keyindx(1)
54 title(forelabel)
55 elseif i>=length(keyindx) %i>=length(keyindx)-1
56 xlabel(conlab)
57 end
58 %
59 grid
60 ylabel(char(ylab(i)))
61 end