From 7b053c7e923a2793105175975187dd0158f2f57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 25 Sep 2019 15:55:06 +0200 Subject: [PATCH] Option graph_format=pdf now works under Octave Also copy the same Octave-specific code as for EPS printing (added in 84f0d6c7daad7c34fc22a76a541d1004528c3524 to fix problems with hybrid Unix/Windows parallel clusters). --- doc/manual/source/the-model-file.rst | 2 +- matlab/dyn_saveas.m | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) 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