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

1 vue (au cours des 30 derniers jours)
yasmeen hadadd
yasmeen hadadd le 5 Fév 2025
Commenté : Voss le 6 Fév 2025
how to save an app.uiaxes as .png with axis off and without title ?
but without change the property in gui at showing

Réponses (1)

Voss
Voss le 5 Fév 2025
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 commentaires
Voss
Voss le 6 Fév 2025
@yasmeen hadadd You're welcome! Any questions, let me know. Otherwise, please "Accept" this answer. Thanks!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Objects dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by