Debian Codegraph @

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

raw
1 function fn_PlotRecessionShades57_01(rec_dates, AxisDat)
2 % Recession shades. For some reasons, Matlab code will only take pairs of rec_dates when using rectangle.
3 % Inputs: rec_dates -- must be in pairs for rectangle to work.
4 % AxisDat -- example: AxisDat=axis([1976 2010 -.2 .15]);
5 % 1976 will automatically cut off the dates before 1976 in the following lines.
6 %
7 % Copyright (C) 1997-2012 Tao Zha
8 %
9 % This free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
13 %
14 % It is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
18 %
19 % If you did not received a copy of the GNU General Public License
20 % with this software, see <http://www.gnu.org/licenses/>.
21 %
22
23 for RecessionNumber=1:length(rec_dates);
24 rectangle('Position', [rec_dates(RecessionNumber,1) AxisDat(3) (rec_dates(RecessionNumber,2)-rec_dates(RecessionNumber,1)) (AxisDat(4)-AxisDat(3))], 'FaceColor','y');
25 end