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 withf = figure('Visible','off');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With