Main Content

getSnapshotImage

Class: mlreportgen.report.Figure
Namespace: mlreportgen.report

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.*

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

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

Version History

Introduced in R2017b