Files
mcm-26-b/scripts/matlab/fig_save.m
T
2026-09-13 10:27:09 +08:00

12 lines
431 B
Matlab
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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