MATLAB Maximizing Plot Window in MATLAB M-file

  • Thread starter Thread starter JoAuSc
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To maximize the plot window in an m-file for creating a movie, use the figure command to control the window size. First, retrieve the screen size with the command "fullscreen = get(0,'ScreenSize');". Then, set the figure window's position using "figure('Position',[0 -50 fullscreen(3) fullscreen(4)])". This approach ensures that the plot window is maximized, allowing subsequent images to expand and fit the window properly.
JoAuSc
Messages
197
Reaction score
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.
 
Physics news on Phys.org
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.
 
Thank you, that's what I was looking for.
 

Similar threads

Back
Top