diff --git a/export_fig.m b/export_fig.m index 46ba97d..f2855d7 100644 --- a/export_fig.m +++ b/export_fig.m @@ -385,6 +385,7 @@ % 13/04/23: (3.36) Reduced (hopefully fixed) unintended EPS/PDF image cropping (issues #97, #318); clarified warning in case of PDF/EPS export of transparent patches (issues #94, #106, #108) % 23/04/23: (3.37) Fixed run-time error with old Matlab releases (issue #374); -notify console message about exported image now displays black (STDOUT) not red (STDERR) % 15/05/23: (3.38) Fixed endless recursion when using export_fig in Live Scripts (issue #375); don't warn about exportgraphics/copygraphics alternatives in deployed mode +% 30/05/23: (3.39) Fixed exported bgcolor of uifigures or figures in Live Scripts (issue #377) %} if nargout @@ -422,7 +423,7 @@ [fig, options] = parse_args(nargout, fig, argNames, varargin{:}); % Check for newer version and exportgraphics/copygraphics compatibility - currentVersion = 3.38; + currentVersion = 3.39; if options.version % export_fig's version requested - return it and bail out imageData = currentVersion; return @@ -468,7 +469,9 @@ end try % Create an invisible legacy figure at the same position/size as the uifigure - hNewFig = figure('Units',hFig.Units, 'Position',hFig.Position, 'MenuBar','none', 'ToolBar','none', 'Visible','off'); + hNewFig = figure('Visible','off', 'Color',hFig.Color, ... + 'Units',hFig.Units, 'Position',hFig.Position, ... + 'MenuBar','none', 'ToolBar','none'); % Copy the uifigure contents onto the new invisible legacy figure try hChildren = allchild(hFig); %=uifig.Children;