function fig_save(fig, S, name) %FIG_SAVE 导出白底 PNG(300 dpi)并关闭图形窗口。 % 导出前关掉坐标轴工具条,避免交互按钮被画进图片。 axs = findall(fig, 'Type', 'axes'); for k = 1:numel(axs) axs(k).Toolbar.Visible = 'off'; end exportgraphics(fig, fullfile(S.out_dir, name), 'Resolution', S.dpi, ... 'BackgroundColor', 'white'); close(fig); end