Maximizing Plot Window in MATLAB M-file

  • Context: MATLAB 
  • Thread starter Thread starter JoAuSc
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

To maximize the plot window in MATLAB using an M-file, utilize the figure command to set the 'Position' property. First, retrieve the screen size with fullscreen = get(0,'ScreenSize');. Then, create a figure with figure('Position',[0 -50 fullscreen(3) fullscreen(4)]); before executing your plot command. This approach ensures that subsequent images expand to fit the maximized window.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of M-files in MATLAB
  • Knowledge of figure properties in MATLAB
  • Basic concepts of screen resolution and dimensions
NEXT STEPS
  • Explore MATLAB figure properties for advanced customization
  • Learn about the getframe function for capturing frames in MATLAB
  • Investigate techniques for creating animations in MATLAB
  • Study MATLAB's graphical user interface (GUI) capabilities
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly those involved in data visualization, animation creation, and graphical representation of data in engineering and scientific applications.

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
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K