Commit bd40e848 authored by Stéphane Adjemian's avatar Stéphane Adjemian

Do not show plots of the smoothed variables, shocks and errors if nograph...

Do not show plots of the smoothed variables, shocks and errors if nograph option is used. Note that with this option the plot are done behind the scene and saved in fig, eps and pdf format (see trac#216).
(cherry picked from commit 12003fbd)
parent c1e9b3f8
...@@ -945,7 +945,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -945,7 +945,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
if nbplt == 1 if nbplt == 1
hh = figure('Name','Smoothed shocks'); if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
for i=1:M_.exo_nbr for i=1:M_.exo_nbr
...@@ -981,7 +985,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -981,7 +985,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(1)]); eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(1)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(1) '.fig']); saveas(hh,[M_.fname '_SmoothedShocks' int2str(1) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:M_.exo_nbr for jj = 1:M_.exo_nbr
...@@ -998,7 +1001,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -998,7 +1001,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end end
else else
for plt = 1:nbplt-1 for plt = 1:nbplt-1
hh = figure('Name','Smoothed shocks'); if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1036,7 +1043,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1036,7 +1043,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(plt)]); eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(plt)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(plt) '.fig']); saveas(hh,[M_.fname '_SmoothedShocks' int2str(plt) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar for jj = 1:nstar
...@@ -1050,7 +1056,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1050,7 +1056,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
end end
end end
hh = figure('Name','Smoothed shocks'); if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1092,7 +1102,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1092,7 +1102,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(nbplt)]); eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(nbplt)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(nbplt) '.fig']); saveas(hh,[M_.fname '_SmoothedShocks' int2str(nbplt) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1); for jj = 1:size(NAMES,1);
...@@ -1143,7 +1152,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1143,7 +1152,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
if nbplt == 1 if nbplt == 1
hh = figure('Name','Smoothed observation errors'); if options_.nograph
hh = figure('Name','Smoothed observation errors','Visible','off');
else
hh = figure('Name','Smoothed observation errors');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1179,7 +1192,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1179,7 +1192,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(1)]); eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(1)]);
saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(1) '.fig']); saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(1) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:number_of_plots_to_draw for jj = 1:number_of_plots_to_draw
...@@ -1196,7 +1208,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1196,7 +1208,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end end
else else
for plt = 1:nbplt for plt = 1:nbplt
hh = figure('Name','Smoothed observation errors'); if options_.nograph
hh = figure('Name','Smoothed observation errors','Visible','off');
else
hh = figure('Name','Smoothed observation errors');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1233,7 +1249,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1233,7 +1249,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(plt)]); eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(plt)]);
saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(plt) '.fig']); saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(plt) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar for jj = 1:nstar
...@@ -1260,7 +1275,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1260,7 +1275,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
if nbplt == 1 if nbplt == 1
hh = figure('Name','Historical and smoothed variables'); if options_.nograph
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
for i=1:n_varobs for i=1:n_varobs
...@@ -1296,7 +1315,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1296,7 +1315,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(1)]); eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(1)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(1) '.fig']); saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(1) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:n_varobs for jj = 1:n_varobs
...@@ -1313,7 +1331,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1313,7 +1331,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end end
else else
for plt = 1:nbplt-1 for plt = 1:nbplt-1
hh = figure('Name','Historical and smoothed variables'); if options_.nograph
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1351,7 +1373,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1351,7 +1373,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)]); eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(plt) '.fig']); saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(plt) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar for jj = 1:nstar
...@@ -1365,7 +1386,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1365,7 +1386,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
end end
end end
hh = figure('Name','Historical and smoothed variables'); if options_.nograph
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
...@@ -1407,7 +1432,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha ...@@ -1407,7 +1432,6 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt)]); eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt) '.fig']); saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt) '.fig']);
end end
if options_.nograph, close(hh), end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1); for jj = 1:size(NAMES,1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment