altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.28k stars 368 forks source link

Changes in Background Color ignored when exporting via Live Script #377

Closed bernb closed 1 year ago

bernb commented 1 year ago

This seems to be a regression introduced by #375 as it worked as intended in version 3.37. The following code produces the correct result when pasted into the command windows. However, if the same code is run as a live script, the background is not changed to white.

[x,y] = meshgrid(1:15,1:15);
z = peaks(15);
T = delaunay(x,y);
p = trisurf(T,x,y,z);
p.Parent.Parent.Color = 'w';
export_fig(p.Parent.Parent, 'tester.pdf');

Same result if exported as PNG. Properties of axes seem to be used correctly. I am not aware of other visually relevant properties of a figure object, so I only tested with the color property.

altmany commented 1 year ago

This was not a regression bug but an unrelated issue due to the fact that non-default bgcolor of uifigures was never handled until now. It's now fixed in the latest commit (de3bc78).