MATLAB Maximizing Plot Window in MATLAB M-file

  • Thread starter Thread starter JoAuSc
  • Start date Start date
  • Tags Tags
    Matlab
Click For 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

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K