Maximizing Plot Window in MATLAB M-file

  • MATLAB
  • Thread starter JoAuSc
  • Start date
  • Tags
    Matlab
In summary, to maximize the plot window while using an m-file to create a movie, you can use the figure command. First, find the size of your screen as a vector and then set the size of the figure window using the 'Position' property. This will allow subsequent images to expand to fit the window.
  • #1
JoAuSc
198
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
  • #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.
 
  • #3
Thank you, that's what I was looking for.
 

FAQ: Maximizing Plot Window in MATLAB M-file

1. How do I maximize the plot window in MATLAB M-file?

To maximize the plot window in MATLAB M-file, you can use the "figure" command followed by the "maximize" command. This will open a new figure window and automatically maximize it.

2. Can I resize the plot window in MATLAB M-file?

Yes, you can resize the plot window in MATLAB M-file by clicking and dragging the edges of the window or by using the "set" command to specify the size of the window in pixels.

3. How can I change the position of the plot window in MATLAB M-file?

You can change the position of the plot window in MATLAB M-file by using the "set" command to specify the coordinates of the window in pixels. Alternatively, you can also use the "movegui" command to move the window to a specific location on the screen.

4. Is it possible to have multiple plot windows open at once in MATLAB M-file?

Yes, it is possible to have multiple plot windows open at once in MATLAB M-file. You can use the "figure" command to open a new figure window for each plot and then use the "subplot" command to arrange the plots within the window.

5. How do I close the plot window in MATLAB M-file?

To close the plot window in MATLAB M-file, you can use the "close" command followed by the name or handle of the figure. You can also close all open figure windows at once by using the "close all" command.

Similar threads

Replies
1
Views
1K
Replies
10
Views
2K
Replies
2
Views
946
Replies
11
Views
3K
Replies
6
Views
2K
Replies
1
Views
1K
Back
Top