Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getSnapshotImage

Get snapshot image path

Syntax

imgpath = getSnapshotImage(figReporter,report)

Description

imgpath = getSnapshotImage(figReporter,report) creates an image of the figure window specified by figReporter and returns a path to a file containing the image. Use this method to customize the layout of figures in your report.

Input Arguments

expand all

Figure reporter object, specified as an mlreportgen.report.Figure object.

Report, specified as a report object. To create the report input, use mlreportgen.report.Report.

Output Arguments

expand all

Figure path of file containing the figure, returned as a string.

Examples

Change the Size of a Snapshot Image

import mlreportgen.report.*
import mlreportgen.dom.*

report = Report('peaks');
surf(peaks(20));
figure = Figure();
peaks20 = Image(getSnapshotImage(figure, report));
peaks20.Width = '3in';
peaks20.Height = [];
figure = peaks20;

delete(gcf);
add(report, figure)
close(report);
rptview(report);

Introduced in R2017b

Was this topic helpful?