Is there a saveas function for axes/graphs in App Designer?
2 次查看(过去 30 天)
显示 更早的评论
We are trying to save a graph as jpg in App Designer, is there a function that is able to do this?
0 个评论
回答(1 个)
prabhat kumar sharma
2024-4-2
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!