2

I have 8 figures and one textbox (a legend listing the values of simulation parameters). They're all plotted in one window using subplot(). It looks nice, but the window pops up too often and distracts me from my other work. I'd like to automatically save these figures as PNG images rather than having the window keep popping up so I can review the plots and figures later.

What I do know:

  • How to save a single figure as a PNG
  • How to use subplot to make multiple figures in a single window
  • How to not display a window with a single figure (one sets the figure's visibility to 'off')

What I don't know:

  • How to make a multi-figure window not pop up
  • How to set the size of a multi-figure window (say, 400 px by 600 px)
  • How to export the entire window to PNG

Any thoughts would be much appreciated. Thanks in advance!

jvriesem
  • 1,859
  • 3
  • 18
  • 40
  • 2
    What function are you using to save a figure with a single plot? `print()` should work the same regardless of how many subplots your figure has. – jerad Dec 17 '12 at 21:29
  • FYI, in Matlab the term Figure refers to what you're calling a "window". You can call the individual plots within a figure subplots or axes. – jerad Dec 17 '12 at 21:31

1 Answers1

0

use

    set('gcf','visible','off')

to off showing all figures, and

   set('gcf','visible,'on')

to turn showing figures on.

to save a figure first assign a name to it:

    fig1 = figure(1);

then use saveas:

    saveas(fig1,'filename.png','png')

to set figure size, see: Setting graph figure size

Community
  • 1
  • 1
Hadi
  • 109
  • 1
  • 10