Skip to content
Snippets Groups Projects
Commit 0b4f3e56 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

add integer ticks to the bottom of IRFs in canned report

parent ca482602
Branches
No related tags found
No related merge requests found
function make_report_irfs(M, oo) function make_report_irfs(M, oo, ticks_every)
% Builds canned IRF report % Builds canned IRF report
% %
% INPUTS % INPUTS
% M [struct] % M [struct]
% oo [struct] % oo [struct]
% ticks_every [int] number of spaces between ticks. Default 5.
% %
% OUTPUTS % OUTPUTS
% None % None
...@@ -46,8 +47,13 @@ function make_report_irfs(M, oo) ...@@ -46,8 +47,13 @@ function make_report_irfs(M, oo)
return return
end end
if nargin < 3
ticks_every = 5;
end
n6 = 1; n6 = 1;
justAddedPage = 0; justAddedPage = 0;
calcxticks = false;
r = report(); r = report();
for i = 1:length(M.exo_names) for i = 1:length(M.exo_names)
newexo = 1; newexo = 1;
...@@ -64,6 +70,12 @@ function make_report_irfs(M, oo) ...@@ -64,6 +70,12 @@ function make_report_irfs(M, oo)
newexo = 0; newexo = 0;
end end
if any(idx) if any(idx)
if ~calcxticks
data = dseries(oo.irfs.(fields{idx})');
xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1;
xTickLabels = strsplit(num2str(xTicks-1));
calcxticks = true;
end
r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ... r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ...
'title', strrep(M.endo_names(j,:), '_', '\_'), ... 'title', strrep(M.endo_names(j,:), '_', '\_'), ...
'titleFormat', '\Huge', ... 'titleFormat', '\Huge', ...
...@@ -71,7 +83,9 @@ function make_report_irfs(M, oo) ...@@ -71,7 +83,9 @@ function make_report_irfs(M, oo)
'yTickLabelZeroFill', false, ... 'yTickLabelZeroFill', false, ...
'yTickLabelPrecision', 1, ... 'yTickLabelPrecision', 1, ...
'showZeroLine', true, ... 'showZeroLine', true, ...
'zeroLineColor', 'red'); 'zeroLineColor', 'red', ...
'xTicks', xTicks, ...
'xTickLabels', xTickLabels);
n6 = n6 + 1; n6 = n6 + 1;
justAddedPage = 0; justAddedPage = 0;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment