Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simple MATLAB question

  1. Sep 29, 2007 #1
    What command would you use to maximize the plot window? I'm trying to use an m-file to create a movie by plotting something, then using M(k) = getframe, but I don't know how to maximize the window from an m-file, and if I just click on the thing on the top right corner of the window, it expands, but the image remains the same.
  2. jcsd
  3. Oct 3, 2007 #2
    You can use the figure command to control the size of the plot window. First, you find the size of your screen, as a vector in the form of [left, bottom, width, height]. Then, you set the size of the figure window for the property 'Position'. The property value for position is in the same form as the screensize property. For example,

    fullscreen = get(0,'ScreenSize');
    figure('Position',[0 -50 fullscreen(3) fullscreen(4)])

    These two lines if placed before your plot command will generate a plot window of the specified size. Subsequent images will then expand to fit the window.
  4. Oct 7, 2007 #3
    Thank you, that's what I was looking for.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook