问题描述:

I have some code that generates a number of MATLAB figures. At the end of my program I want to publish these figures in a report. I have a script, which is passed to publish(), that uses openfig() to include the figures in the document.

This causes these figures to flash up on the screen. This is particularly annoying when I am opening figures inside a loop using a combination of close and snapnow. I've tried making these figures invisible using

openfig(PathToFigure, 'new', 'invisible')

This stops the image appearing on the screen but also stops it appearing in the report.

Is there a way of including .fig files in the report without having them appear on screen?

网友答案:

Open the figure with f=openfig(PathToFigure, 'new', 'invisible'). Then move the figure off-screen by setting its Position property (perhaps to something with negative values for the left and bottom pixels), set its Visible property to on, call snapnow. Delete the figure.

网友答案:

I would actually recommend setting their visibility to 'off' when you create those figures with
f = figure('Visible','off');

相关阅读:
Top