export_fig,GUI和gcf - Matlab 2015b

时间:2016-06-21 12:48:21

标签: matlab

我在网上找到了以下代码(http://www.mathworks.com/matlabcentral/newsreader/view_thread/322200

[fileName filePath] = uiputfile('*.jpg','Save As');
if filePath == 0
    return;
end
saveFileAs = ([filePath fileName]);
addpath('export_fig')
export_fig(handles.axes1,saveFileAs);
set(gcf, 'Color', 'w');

我在Matlab GUI中使用它(通过按钮)。我的问题是,我需要设置(gcf,'颜色','w')行,因为我删除它,一切看起来都好吗?它做了什么?

由于

1 个答案:

答案 0 :(得分:1)

set(gcf, 'Color', 'w');

...设置当前图形白色的背景

了解更多信息see herehere

您不需要导出图形的这一行代码,因为图像会事先导出。

相关问题