Skip to content
Snippets Groups Projects
Commit fe98a087 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added the possibility to save the plots generated by the shock_decomposition command.

parent 15025626
No related branches found
No related tags found
No related merge requests found
function []=graph_decomp(z,shock_names,endo_names,i_var,initial_date) function []=graph_decomp(z,shock_names,endo_names,i_var,initial_date,DynareModel,DynareOptions)
%function []=graph_decomp(z,varlist,initial_period,freq) %function []=graph_decomp(z,varlist,initial_period,freq)
% Copyright (C) 2010-2011 Dynare Team % Copyright (C) 2010-2011 Dynare Team
...@@ -39,7 +39,7 @@ for j=1:nvar ...@@ -39,7 +39,7 @@ for j=1:nvar
if ymax-ymin < 1e-6 if ymax-ymin < 1e-6
continue continue
end end
figure('Name',endo_names(i_var(j),:)); fhandle = dyn_figure(DynareOptions,'Name',endo_names(i_var(j),:));
ax=axes('Position',[0.1 0.1 0.6 0.8]); ax=axes('Position',[0.1 0.1 0.6 0.8]);
axis(ax,[xmin xmax ymin ymax]); axis(ax,[xmin xmax ymin ymax]);
plot(ax,x(2:end),z1(end,:),'k-','LineWidth',2) plot(ax,x(2:end),z1(end,:),'k-','LineWidth',2)
...@@ -78,5 +78,7 @@ for j=1:nvar ...@@ -78,5 +78,7 @@ for j=1:nvar
hold on hold on
y1 = y1 + height; y1 = y1 + height;
end end
dyn_saveas(fhandle,[DynareModel.fname '_shock_decomposition_' endo_names(i_var(j),:)],DynareOptions);
hold off hold off
end end
\ No newline at end of file
...@@ -107,4 +107,4 @@ end ...@@ -107,4 +107,4 @@ end
oo_.shock_decomposition = z; oo_.shock_decomposition = z;
graph_decomp(z,M_.exo_names,M_.endo_names,i_var,options_.initial_date) graph_decomp(z,M_.exo_names,M_.endo_names,i_var,options_.initial_date,M_,options_)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment