how to save an app.uiaxes as .png with axis off and without title ?

1 次查看(过去 30 天)
how to save an app.uiaxes as .png with axis off and without title ?
but without change the property in gui at showing

回答(1 个)

Voss
Voss 2025-2-5
filename = 'output.png';
ax = app.UIAxes;
ax_vis = strcmp(ax.Visible,'on');
if ax_vis
ax.Visible = 'off';
end
exportgraphics(ax,filename)
if ax_vis
ax.Visible = 'on';
end
  4 个评论
Voss
Voss 2025-2-6
@yasmeen hadadd You're welcome! Any questions, let me know. Otherwise, please "Accept" this answer. Thanks!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by