Is there a saveas function for axes/graphs in App Designer?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
We are trying to save a graph as jpg in App Designer, is there a function that is able to do this?
0 comentarios
Respuestas (1)
prabhat kumar sharma
el 2 de Abr. de 2024
Hi Laura,
I understand you want to save your graph as a jpg image. I belive saveas function is not supported with figures created using uifigure, which is the type of figure used in MATLAB App Designer.
However, exportgraphics is designed to work with uifigure-based figures, making it the recommended approach for saving graphics from App Designer apps.
Please find the below code for refrence:
% Create some data and plot it
x = linspace(0, 2*pi, 100);
y = sin(x);
fig = figure;
plot(x, y);
% Save the figure to a JPG file using exportgraphics()
filename = 'plot_exportgraphics.jpg';
exportgraphics(gca, filename);
I hope it helps!
0 comentarios
Ver también
Categorías
Más información sobre Printing and Saving en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!