diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst index 13cf90601..4ab96bce4 100644 --- a/doc/manual/source/the-model-file.rst +++ b/doc/manual/source/the-model-file.rst @@ -3166,7 +3166,7 @@ Computing the stochastic solution Specify the file format(s) for graphs saved to disk. Possible values are ``eps`` (the default), ``pdf``, ``fig`` and ``none`` - (under Octave, only ``eps`` and ``none`` are available). If the + (under Octave, ``fig`` is unavailable). If the file format is set equal to ``none``, the graphs are displayed but not saved to the disk. diff --git a/matlab/dyn_saveas.m b/matlab/dyn_saveas.m index 009a49d5e..a605b5c9b 100644 --- a/matlab/dyn_saveas.m +++ b/matlab/dyn_saveas.m @@ -14,7 +14,7 @@ function dyn_saveas(h, fname, nodisplay, graph_format) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2012-2017 Dynare Team +% Copyright (C) 2012-2019 Dynare Team % % This file is part of Dynare. % @@ -43,10 +43,13 @@ if any(strcmp('eps',cellstr(graph_format))) end if any(strcmp('pdf',cellstr(graph_format))) if isoctave - error('Octave cannot create pdf files!') - else - print(h,'-dpdf',[fname,'.pdf']) + fname = strrep(fname,'/',filesep); + fname = strrep(fname,'\',filesep); + if nodisplay && ispc + set(h, 'Visible','on'); + end end + print(h,'-dpdf',[fname,'.pdf']) end if any(strcmp('fig',cellstr(graph_format))) if isoctave