Octave: support ofig graph format

kalman-mex
Johannes Pfeifer 2023-10-04 20:42:31 +02:00 committed by Sébastien Villemot
parent d77561e241
commit 32d5bc05a1
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 6 additions and 11 deletions

View File

@ -4499,8 +4499,8 @@ Computing the stochastic solution
graph_format = ( FORMAT, FORMAT... )
Specify the file format(s) for graphs saved to disk. Possible
values are ``eps`` (the default), ``pdf``, ``fig`` and ``none``
(under Octave, ``fig`` is unavailable). If the
values are ``eps`` (the default), ``pdf``, ``fig`` and ``none``.
Under Octave, ``fig`` will use Octaves ``ofig`` format. If the
file format is set equal to ``none``, the graphs are displayed
but not saved to the disk.

View File

@ -52,17 +52,12 @@ if any(strcmp('pdf',cellstr(graph_format)))
print(h,'-dpdf',[fname,'.pdf'])
end
if any(strcmp('fig',cellstr(graph_format)))
if nodisplay
set(h,'CreateFcn','set(gcf, ''Visible'',''on'')') ;
end
if isoctave
error('Octave cannot create fig files!')
saveas(h,[fname '.ofig']);
else
if nodisplay
% THE FOLLOWING LINES COULD BE USED IF BUGS/PROBLEMS ARE REPORTED USING LINE 60
% set(h,'Units','Normalized')
% mypos=get(h,'Position');
% set(h,'Position',[-1 -1 mypos(3:4)])
% set(h, 'Visible','on');
set(h,'CreateFcn','set(gcf, ''Visible'',''on'')') ;
end
saveas(h,[fname '.fig']);
end
end