3
votes

I am producing a large number of graphs in matlab R2011b. I would like to make use of the ('visible', 'off') figure property so that I don't need to display each plot on the screen---each plot contains a lot of data and several subplots so rendering them takes up time and unnecessary processing power (I save them directly to an image).

Each plot contains four subplots and I would like to add a super "title" to each figure. I have been using suptitle (part of the bioinfo toolbox) but it appears that using suptitle undoes the effect of ('visible, 'off') and the figure is displayed anyway.

xdata = -100:1:100;
ydata = -100:1:100;
zdata = rand(1,201)*-50;

fig1 = figure(1)
set(fig1, 'visible', 'off')
subplot(2,1,1)
scatter(xdata, ydata, 10, zdata)
title('Small title 1')
subplot(2,1,2)
scatter(xdata, ydata, 10, zdata)
title('small title 2')
suptitle('This is a big title') 

Using this code, the graph is displayed. If the suptitle line is commented out then the figure is not displayed (which is what I want).

Does anyone know

  1. Why this happens?
  2. How I can fix it /work around it? Is there another way of adding a large title to a figure with subplots?

Thanks.

1
I don't have this toolbox. Can you put the source of this suptitle.m?Andrey Rubshtein
@Andrey this isn't the exact version, but its very similar: willame.francois.free.fr/edu/xjobb/doc/SIMULHOPE/simulhope/plot/… .FakeDIY

1 Answers

2
votes

Just copy this line to the end of your sample code:

 set(fig1, 'visible', 'off')

This should solve your issue...