Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing .fig files without having them appear on screen

Tags:

matlab

publish

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?

like image 528
Zapadus Avatar asked Dec 03 '12 11:12

Zapadus


2 Answers

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.

like image 106
Sam Roberts Avatar answered Oct 13 '22 19:10

Sam Roberts


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

like image 27
slezadav Avatar answered Oct 13 '22 18:10

slezadav