Fix saving of graphs in forecast_graphs.m
Did not use the M_.dname folder, but rather fnametime-shift
parent
a339164b77
commit
6f7265337b
|
@ -8,7 +8,7 @@ function forecast_graphs(var_list,M_, oo_,options_)
|
||||||
% o oo_ outputs structure
|
% o oo_ outputs structure
|
||||||
% o options_ options structure
|
% o options_ options structure
|
||||||
|
|
||||||
% Copyright (C) 2008-2013 Dynare Team
|
% Copyright (C) 2008-2015 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -30,6 +30,7 @@ nr = 3;
|
||||||
exo_nbr = M_.exo_nbr;
|
exo_nbr = M_.exo_nbr;
|
||||||
endo_names = M_.endo_names;
|
endo_names = M_.endo_names;
|
||||||
fname = M_.fname;
|
fname = M_.fname;
|
||||||
|
dname = M_.dname;
|
||||||
yf = oo_.forecast.Mean;
|
yf = oo_.forecast.Mean;
|
||||||
hpdinf = oo_.forecast.HPDinf;
|
hpdinf = oo_.forecast.HPDinf;
|
||||||
hpdsup = oo_.forecast.HPDsup;
|
hpdsup = oo_.forecast.HPDsup;
|
||||||
|
@ -40,18 +41,18 @@ i_var = [];
|
||||||
for i = 1:size(var_list)
|
for i = 1:size(var_list)
|
||||||
tmp = strmatch(var_list(i,:),endo_names,'exact');
|
tmp = strmatch(var_list(i,:),endo_names,'exact');
|
||||||
if isempty(tmp)
|
if isempty(tmp)
|
||||||
error([var_list(i,:) ' isn''t and endogenous variable'])
|
error([var_list(i,:) ' isn''t an endogenous variable'])
|
||||||
end
|
end
|
||||||
i_var = [i_var; tmp];
|
i_var = [i_var; tmp];
|
||||||
end
|
end
|
||||||
nvar = length(i_var);
|
nvar = length(i_var);
|
||||||
|
|
||||||
% create subdirectory <fname>/graphs if id doesn't exist
|
% create subdirectory <dname>/graphs if id doesn't exist
|
||||||
if ~exist(fname, 'dir')
|
if ~exist(dname, 'dir')
|
||||||
mkdir('.',fname);
|
mkdir('.',dname);
|
||||||
end
|
end
|
||||||
if ~exist([fname '/graphs'])
|
if ~exist([dname '/graphs'],'dir')
|
||||||
mkdir(fname,'graphs');
|
mkdir(dname,'graphs');
|
||||||
end
|
end
|
||||||
|
|
||||||
m = 1;
|
m = 1;
|
||||||
|
@ -59,7 +60,7 @@ n_fig = 1;
|
||||||
hh=dyn_figure(options_,'Name','Forecasts (I)');
|
hh=dyn_figure(options_,'Name','Forecasts (I)');
|
||||||
for j= 1:nvar
|
for j= 1:nvar
|
||||||
if m > nc*nr;
|
if m > nc*nr;
|
||||||
dyn_saveas(hh,[ fname '/graphs/forcst' int2str(n_fig)],options_);
|
dyn_saveas(hh,[ dname '/graphs/forcst' int2str(n_fig)],options_);
|
||||||
|
|
||||||
n_fig =n_fig+1;
|
n_fig =n_fig+1;
|
||||||
eval(['hh=dyn_figure(options_,''Name'',''Forecasts (' int2str(n_fig) ')'');']);
|
eval(['hh=dyn_figure(options_,''Name'',''Forecasts (' int2str(n_fig) ')'');']);
|
||||||
|
@ -87,5 +88,5 @@ for j= 1:nvar
|
||||||
end
|
end
|
||||||
|
|
||||||
if m > 1
|
if m > 1
|
||||||
dyn_saveas(hh,[fname '/graphs/forcst' int2str(n_fig)],options_);
|
dyn_saveas(hh,[dname '/graphs/forcst' int2str(n_fig)],options_);
|
||||||
end
|
end
|
Loading…
Reference in New Issue