Option graph_format=pdf now works under Octave

Also copy the same Octave-specific code as for EPS printing (added in
84f0d6c7da to fix problems with hybrid
Unix/Windows parallel clusters).
time-shift
Sébastien Villemot 2019-09-25 15:55:06 +02:00
parent ee9852ac2c
commit 7b053c7e92
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 8 additions and 5 deletions

View File

@ -3166,7 +3166,7 @@ Computing the stochastic solution
Specify the file format(s) for graphs saved to disk. Possible Specify the file format(s) for graphs saved to disk. Possible
values are ``eps`` (the default), ``pdf``, ``fig`` and ``none`` 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 file format is set equal to ``none``, the graphs are displayed
but not saved to the disk. but not saved to the disk.

View File

@ -14,7 +14,7 @@ function dyn_saveas(h, fname, nodisplay, graph_format)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2012-2017 Dynare Team % Copyright (C) 2012-2019 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -43,10 +43,13 @@ if any(strcmp('eps',cellstr(graph_format)))
end end
if any(strcmp('pdf',cellstr(graph_format))) if any(strcmp('pdf',cellstr(graph_format)))
if isoctave if isoctave
error('Octave cannot create pdf files!') fname = strrep(fname,'/',filesep);
else fname = strrep(fname,'\',filesep);
print(h,'-dpdf',[fname,'.pdf']) if nodisplay && ispc
set(h, 'Visible','on');
end
end end
print(h,'-dpdf',[fname,'.pdf'])
end end
if any(strcmp('fig',cellstr(graph_format))) if any(strcmp('fig',cellstr(graph_format)))
if isoctave if isoctave