From bb94a39c857dfca2843f852547dc7c1b86e59311 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Fri, 27 Apr 2012 11:48:26 +0200 Subject: [PATCH] When nodisplay=1, the figure has to be set visible before saving and closing, otherwise it is saved as not visible and when users try to open it, the saved figure is invisible (ticket 216). The process is so quick that the figure is closed before it is made visible on the screen, so complying with nodisplay requirements, keeping thew whole procedure behind the scenes. --- matlab/dyn_saveas.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/dyn_saveas.m b/matlab/dyn_saveas.m index c9e478951..f9ade453e 100644 --- a/matlab/dyn_saveas.m +++ b/matlab/dyn_saveas.m @@ -38,6 +38,9 @@ if ~exist('OCTAVE_VERSION') eval(['print -dpdf ' fname]); end if find(strcmp('fig',DynareOptions.graph_format)) + if DynareOptions.nodisplay + set(h, 'Visible','on'); + end saveas(h,[fname '.fig']); end end