Unfortunately, there is currently no completely programmatic way to include snapshots of uiaxes in a report from a web application, for the reasons you already listed.
With version R2019a and later, you can use the figure toolbar to download a snapshot of the axes. The toolbar appears in the top right corner of the axes when you hover your mouse over the axes. To save the figure, mouse over the left-most toolbar icon and select the save icon that appears.
From there, you can use the uigetfile function to prompt the user to specify the saved snapshot image file and then insert the image into the report.
imgPath = uigetfile("*.png", "Select the axes snapshot image file");
if ~isempty(imgPath)
imgRptr = mlreportgen.dom.Image(imgPath);
add(rpt, img);
end
0 Comments
Sign in to comment.