Some better diversification of fig names and captions
parent
27f4f81bbd
commit
f87e240b30
|
@ -66,6 +66,10 @@ end
|
|||
fig_names=regexprep(fig_names_long, ' ', '_');
|
||||
fig_names=strrep(fig_names, '.', '');
|
||||
fig_names=strrep(fig_names, '-', '');
|
||||
fig_names=strrep(fig_names, '(given', '');
|
||||
fig_names=strrep(fig_names, '(vintage', '');
|
||||
fig_names=strrep(fig_names, ')', '');
|
||||
fig_names=strrep(fig_names, '(', '');
|
||||
|
||||
interactive = opts_decomp.interactive;
|
||||
|
||||
|
@ -89,6 +93,12 @@ if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
|
|||
fprintf(fidTeX,' \n');
|
||||
end
|
||||
|
||||
if opts_decomp.vintage && opts_decomp.realtime>1,
|
||||
preamble_txt = 'Shock decomposition';
|
||||
else
|
||||
preamble_txt = 'Historical shock decomposition';
|
||||
end
|
||||
|
||||
if ~(screen_shocks && comp_nbr>18),
|
||||
screen_shocks=0;
|
||||
end
|
||||
|
@ -117,7 +127,7 @@ for j=1:nvar
|
|||
if ymax-ymin < 1e-6
|
||||
continue
|
||||
end
|
||||
fhandle = dyn_figure(DynareOptions,'Name',['Shock decomposition: ' deblank(endo_names(i_var(j),:)) strrep(fig_mode1, '_', ' ') fig_names_long '.'], 'PaperPositionMode', 'auto','PaperOrientation','landscape','renderermode','auto');
|
||||
fhandle = dyn_figure(DynareOptions,'Name',[preamble_txt fig_names_long strrep(fig_mode1, '_', ' ') ': ' deblank(endo_names(i_var(j),:)) '.'], 'PaperPositionMode', 'auto','PaperOrientation','landscape','renderermode','auto');
|
||||
set(fhandle,'position' ,[50 50 1500 750])
|
||||
ax=axes('Position',[0.1 0.1 0.6 0.8],'box','on');
|
||||
% plot(ax,x(2:end),z1(end,:),'k-','LineWidth',2)
|
||||
|
@ -199,13 +209,13 @@ for j=1:nvar
|
|||
colormap(new_colormap)
|
||||
end
|
||||
hold off
|
||||
dyn_saveas(fhandle,[GraphDirectoryName, filesep, DynareModel.fname,'_shock_decomposition_',fig_mode,deblank(endo_names(i_var(j),:)),fig_names],DynareOptions);
|
||||
dyn_saveas(fhandle,[GraphDirectoryName, filesep, DynareModel.fname,'_shock_decomposition_',deblank(endo_names(i_var(j),:)),fig_mode1,fig_names],DynareOptions);
|
||||
if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
|
||||
fprintf(fidTeX,'\\begin{figure}[H]\n');
|
||||
fprintf(fidTeX,'\\centering \n');
|
||||
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s/graphs/%s_shock_decomposition_%s}\n',DynareModel.fname,DynareModel.fname,[fig_mode deblank(endo_names(i_var(j),:)) fig_names]);
|
||||
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s/graphs/%s_shock_decomposition_%s}\n',DynareModel.fname,DynareModel.fname,[deblank(endo_names(i_var(j),:)) fig_mode1 fig_names]);
|
||||
fprintf(fidTeX,'\\label{Fig:shock_decomp:%s}\n',[fig_mode deblank(endo_names(i_var(j),:)) fig_names]);
|
||||
fprintf(fidTeX,['\\caption{Historical shock decomposition: $ %s $ ' strrep(fig_mode1, '_', ' ') fig_names_long '.}\n'],deblank(DynareModel.endo_names_tex(i_var(j),:)));
|
||||
fprintf(fidTeX,['\\caption{' preamble_txt fig_names_long strrep(fig_mode1, '_', ' ') ': $ %s $.}\n'],deblank(DynareModel.endo_names_tex(i_var(j),:)));
|
||||
fprintf(fidTeX,'\\end{figure}\n');
|
||||
fprintf(fidTeX,' \n');
|
||||
end
|
||||
|
|
|
@ -65,6 +65,10 @@ end
|
|||
fig_names=regexprep(fig_names_long, ' ', '_');
|
||||
fig_names=strrep(fig_names, '.', '');
|
||||
fig_names=strrep(fig_names, '-', '');
|
||||
fig_names=strrep(fig_names, '(given', '');
|
||||
fig_names=strrep(fig_names, '(vintage', '');
|
||||
fig_names=strrep(fig_names, ')', '');
|
||||
fig_names=strrep(fig_names, '(', '');
|
||||
% fig_names1 = [fig_names];
|
||||
% fig_names = [fig_names '_'];
|
||||
|
||||
|
@ -107,6 +111,12 @@ if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
|
|||
fprintf(fidTeX,' \n');
|
||||
end
|
||||
|
||||
if opts_decomp.vintage && opts_decomp.realtime>1,
|
||||
preamble_txt = 'Shock decomposition';
|
||||
else
|
||||
preamble_txt = 'Historical shock decomposition';
|
||||
end
|
||||
|
||||
ncol=3;
|
||||
nrow=ceil(comp_nbr/ncol);
|
||||
ntotrow = nrow;
|
||||
|
@ -140,7 +150,7 @@ for j=1:nvar
|
|||
continue
|
||||
end
|
||||
for jf = 1:nfigs
|
||||
fhandle = dyn_figure(DynareOptions,'Name',['Shock decomposition (detail): ' deblank(endo_names(i_var(j),:)) strrep(fig_mode1, '_', ' ') fig_names_long '.'],'position',[200 100 650 850], 'PaperPositionMode', 'auto','PaperOrientation','portrait','renderermode','auto');
|
||||
fhandle = dyn_figure(DynareOptions,'Name',[preamble_txt fig_names_long strrep(fig_mode1, '_', ' ') ': ' deblank(endo_names(i_var(j),:)) ' (detail).'],'position',[200 100 650 850], 'PaperPositionMode', 'auto','PaperOrientation','portrait','renderermode','auto');
|
||||
a0=zeros(1,4);
|
||||
a0(3)=inf;
|
||||
a0(4)=-inf;
|
||||
|
@ -212,13 +222,13 @@ for j=1:nvar
|
|||
else
|
||||
suffix = ['_detail'];
|
||||
end
|
||||
dyn_saveas(fhandle,[GraphDirectoryName, filesep, DynareModel.fname,'_shock_decomposition_',fig_mode,deblank(endo_names(i_var(j),:)),fig_names suffix],DynareOptions);
|
||||
dyn_saveas(fhandle,[GraphDirectoryName, filesep, DynareModel.fname,'_shock_decomposition_',deblank(endo_names(i_var(j),:)),fig_mode1,fig_names suffix],DynareOptions);
|
||||
if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
|
||||
fprintf(fidTeX,'\\begin{figure}[H]\n');
|
||||
fprintf(fidTeX,'\\centering \n');
|
||||
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s/graphs/%s_shock_decomposition_%s}\n',DynareModel.fname,DynareModel.fname,[fig_mode deblank(endo_names(i_var(j),:)) fig_names suffix]);
|
||||
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s/graphs/%s_shock_decomposition_%s}\n',DynareModel.fname,DynareModel.fname,[deblank(endo_names(i_var(j),:)) fig_mode1 fig_names suffix]);
|
||||
fprintf(fidTeX,'\\label{Fig:shock_decomp_detail:%s}\n',[fig_mode deblank(endo_names(i_var(j),:)) fig_names suffix]);
|
||||
fprintf(fidTeX,['\\caption{Historical shock decomposition: $ %s $ ' strrep(fig_mode1, '_', ' ') fig_names_long, '.}\n'],deblank(DynareModel.endo_names_tex(i_var(j),:)));
|
||||
fprintf(fidTeX,['\\caption{' preamble_txt fig_names_long strrep(fig_mode1, '_', ' ') ': $ %s $ (detail).}\n'],deblank(DynareModel.endo_names_tex(i_var(j),:)));
|
||||
fprintf(fidTeX,'\\end{figure}\n');
|
||||
fprintf(fidTeX,' \n');
|
||||
end
|
||||
|
|
|
@ -77,30 +77,30 @@ switch realtime_
|
|||
case 1 % realtime
|
||||
if vintage_
|
||||
z = oo_.realtime_shock_decomposition.(['time_' int2str(vintage_)]);
|
||||
fig_names1=[fig_names ' realtime. ' char(initial_date+vintage_-1)];
|
||||
fig_names1=[fig_names ' realtime (vintage ' char(initial_date+vintage_-1) ')'];
|
||||
else
|
||||
z = oo_.realtime_shock_decomposition.pool;
|
||||
fig_names1=[fig_names ' realtime pool'];
|
||||
fig_names1=[fig_names ' realtime (rolling)'];
|
||||
end
|
||||
|
||||
case 2 % conditional
|
||||
if vintage_
|
||||
z = oo_.conditional_shock_decomposition.(['time_' int2str(vintage_)]);
|
||||
initial_date = options_.initial_date+vintage_-forecast_;
|
||||
fig_names1=[fig_names ' conditional ' int2str(forecast_) '-step ' char(initial_date)];
|
||||
fig_names1=[fig_names ' ' int2str(forecast_) '-step ahead conditional forecast (given ' char(initial_date) ')'];
|
||||
else
|
||||
z = oo_.conditional_shock_decomposition.pool;
|
||||
fig_names1=[fig_names ' conditional pool'];
|
||||
fig_names1=[fig_names ' 1-step ahead conditional forecast (rolling)'];
|
||||
end
|
||||
|
||||
case 3 % forecast
|
||||
if vintage_
|
||||
z = oo_.realtime_forecast_shock_decomposition.(['time_' int2str(vintage_)]);
|
||||
initial_date = options_.initial_date+vintage_-1;
|
||||
fig_names1=[fig_names ' forecast ' int2str(forecast_) '-step ' char(initial_date)];
|
||||
fig_names1=[fig_names ' ' int2str(forecast_) '-step ahead forecast (given ' char(initial_date) ')'];
|
||||
else
|
||||
z = oo_.realtime_forecast_shock_decomposition.pool;
|
||||
fig_names1=[fig_names ' forecast 1-step pool'];
|
||||
fig_names1=[fig_names ' 1-step ahead forecast (rolling)'];
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue