Make sure IRFs only have full periods as xticks
parent
73afe7d02f
commit
424050f380
|
@ -119,6 +119,7 @@ for i=fpar:npar,
|
||||||
box on
|
box on
|
||||||
axis tight
|
axis tight
|
||||||
xlim([1 options_.irf]);
|
xlim([1 options_.irf]);
|
||||||
|
remove_fractional_xticks;
|
||||||
hold off
|
hold off
|
||||||
else
|
else
|
||||||
h1 = area(1:options_.irf,HPDIRF(:,2,j,i),'FaceColor',[.9 .9 .9],'BaseValue',min([min(HPDIRF(:,1,j,i)),min(HPDIRFdsgevar(:,1,j,i))])); %grey below HPDIsup and minimum of HPDIinf and HPDIRFdsgevar
|
h1 = area(1:options_.irf,HPDIRF(:,2,j,i),'FaceColor',[.9 .9 .9],'BaseValue',min([min(HPDIRF(:,1,j,i)),min(HPDIRFdsgevar(:,1,j,i))])); %grey below HPDIsup and minimum of HPDIinf and HPDIRFdsgevar
|
||||||
|
@ -132,6 +133,7 @@ for i=fpar:npar,
|
||||||
box on
|
box on
|
||||||
axis tight
|
axis tight
|
||||||
xlim([1 options_.irf]);
|
xlim([1 options_.irf]);
|
||||||
|
remove_fractional_xticks;
|
||||||
hold off
|
hold off
|
||||||
end
|
end
|
||||||
name = deblank(varlist(j,:));
|
name = deblank(varlist(j,:));
|
||||||
|
|
|
@ -262,6 +262,7 @@ if options_.irf
|
||||||
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
||||||
hold off
|
hold off
|
||||||
xlim([1 options_.irf]);
|
xlim([1 options_.irf]);
|
||||||
|
remove_fractional_xticks;
|
||||||
title(deblank(mylist(j,:)),'Interpreter','none');
|
title(deblank(mylist(j,:)),'Interpreter','none');
|
||||||
end
|
end
|
||||||
dyn_saveas(hh,[M_.fname '_IRF_' deblank(tit(i,:))],options_);
|
dyn_saveas(hh,[M_.fname '_IRF_' deblank(tit(i,:))],options_);
|
||||||
|
@ -271,7 +272,7 @@ if options_.irf
|
||||||
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist(j,:)),deblank(mylistTeX(j,:)));
|
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist(j,:)),deblank(mylistTeX(j,:)));
|
||||||
end
|
end
|
||||||
fprintf(fidTeX,'\\centering \n');
|
fprintf(fidTeX,'\\centering \n');
|
||||||
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_IRF_%s}\n',M_.fname,deblank(tit(i,:)));
|
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s_IRF_%s}\n',M_.fname,deblank(tit(i,:)));
|
||||||
fprintf(fidTeX,'\\caption{Impulse response functions (orthogonalized shock to $%s$).}',titTeX(i,:));
|
fprintf(fidTeX,'\\caption{Impulse response functions (orthogonalized shock to $%s$).}',titTeX(i,:));
|
||||||
fprintf(fidTeX,'\\label{Fig:IRF:%s}\n',deblank(tit(i,:)));
|
fprintf(fidTeX,'\\label{Fig:IRF:%s}\n',deblank(tit(i,:)));
|
||||||
fprintf(fidTeX,'\\end{figure}\n');
|
fprintf(fidTeX,'\\end{figure}\n');
|
||||||
|
@ -293,6 +294,7 @@ if options_.irf
|
||||||
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
||||||
hold off
|
hold off
|
||||||
xlim([1 options_.irf]);
|
xlim([1 options_.irf]);
|
||||||
|
remove_fractional_xticks
|
||||||
title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none');
|
title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none');
|
||||||
end
|
end
|
||||||
dyn_saveas(hh,[ M_.fname '_IRF_' deblank(tit(i,:)) int2str(fig)],options_);
|
dyn_saveas(hh,[ M_.fname '_IRF_' deblank(tit(i,:)) int2str(fig)],options_);
|
||||||
|
@ -302,7 +304,7 @@ if options_.irf
|
||||||
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist((fig-1)*nstar+j,:)),deblank(mylistTeX((fig-1)*nstar+j,:)));
|
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist((fig-1)*nstar+j,:)),deblank(mylistTeX((fig-1)*nstar+j,:)));
|
||||||
end
|
end
|
||||||
fprintf(fidTeX,'\\centering \n');
|
fprintf(fidTeX,'\\centering \n');
|
||||||
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(fig));
|
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(fig));
|
||||||
if options_.relative_irf
|
if options_.relative_irf
|
||||||
fprintf(fidTeX,['\\caption{Relative impulse response' ...
|
fprintf(fidTeX,['\\caption{Relative impulse response' ...
|
||||||
' functions (orthogonalized shock to $%s$).}'],deblank(titTeX(i,:)));
|
' functions (orthogonalized shock to $%s$).}'],deblank(titTeX(i,:)));
|
||||||
|
@ -325,6 +327,7 @@ if options_.irf
|
||||||
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
||||||
hold off
|
hold off
|
||||||
xlim([1 options_.irf]);
|
xlim([1 options_.irf]);
|
||||||
|
remove_fractional_xticks
|
||||||
title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none');
|
title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none');
|
||||||
end
|
end
|
||||||
dyn_saveas(hh,[ M_.fname '_IRF_' deblank(tit(i,:)) int2str(nbplt) ],options_);
|
dyn_saveas(hh,[ M_.fname '_IRF_' deblank(tit(i,:)) int2str(nbplt) ],options_);
|
||||||
|
@ -334,7 +337,7 @@ if options_.irf
|
||||||
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist((nbplt-1)*nstar+j,:)),deblank(mylistTeX((nbplt-1)*nstar+j,:)));
|
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{$%s$}\n'],deblank(mylist((nbplt-1)*nstar+j,:)),deblank(mylistTeX((nbplt-1)*nstar+j,:)));
|
||||||
end
|
end
|
||||||
fprintf(fidTeX,'\\centering \n');
|
fprintf(fidTeX,'\\centering \n');
|
||||||
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(nbplt));
|
fprintf(fidTeX,'\\includegraphics[width=0.8\\textwidth]{%s_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(nbplt));
|
||||||
if options_.relative_irf
|
if options_.relative_irf
|
||||||
fprintf(fidTeX,['\\caption{Relative impulse response functions' ...
|
fprintf(fidTeX,['\\caption{Relative impulse response functions' ...
|
||||||
' (orthogonalized shock to $%s$).}'],deblank(titTeX(i,:)));
|
' (orthogonalized shock to $%s$).}'],deblank(titTeX(i,:)));
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
function remove_fractional_xticks
|
||||||
|
% function remove_fractional_xticks
|
||||||
|
% removes non-integer xtick-labels
|
||||||
|
|
||||||
|
% Copyright (C) 2001-2016 Dynare Team
|
||||||
|
%
|
||||||
|
% This file is part of Dynare.
|
||||||
|
%
|
||||||
|
% Dynare is free software: you can redistribute it and/or modify
|
||||||
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
|
% (at your option) any later version.
|
||||||
|
%
|
||||||
|
% Dynare is distributed in the hope that it will be useful,
|
||||||
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
% GNU General Public License for more details.
|
||||||
|
%
|
||||||
|
% You should have received a copy of the GNU General Public License
|
||||||
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
xticks=get(gca,'xtick');
|
||||||
|
fractional_periods=find(rem(xticks,1)~=0);
|
||||||
|
if ~isempty(fractional_periods)
|
||||||
|
xticks(fractional_periods)=[];
|
||||||
|
xticklabels=get(gca,'xticklabel');
|
||||||
|
xticklabels(fractional_periods)=[];
|
||||||
|
set(gca,'xtick',xticks);
|
||||||
|
set(gca,'xticklabel',xticklabels);
|
||||||
|
end
|
Loading…
Reference in New Issue