Simple Matlab Graphics Question

  • Context: MATLAB 
  • Thread starter Thread starter Raging Dragon
  • Start date Start date
  • Tags Tags
    Graphics Matlab
Click For Summary
SUMMARY

The discussion focuses on maximizing figure windows in MATLAB while iteratively generating and naming multiple graphs within a for loop. The user aims to save 60 graphs efficiently, utilizing the 'Position' property of the figure function. A solution involves setting the default figure size using the command set(0, 'DefaultFigurePosition', [0 -50 fullscreen(3) fullscreen(4)]) before plotting, which ensures that all new figures are maximized. This method eliminates the error encountered when using incorrect arguments with the figure function.

PREREQUISITES
  • Familiarity with MATLAB programming language
  • Understanding of figure properties in MATLAB
  • Basic knowledge of for loops in programming
  • Experience with graphical output in MATLAB
NEXT STEPS
  • Research MATLAB figure properties and customization techniques
  • Explore advanced MATLAB plotting functions and their options
  • Learn about MATLAB's graphical user interface (GUI) capabilities
  • Investigate efficient file-saving methods for multiple figures in MATLAB
USEFUL FOR

This discussion is beneficial for MATLAB users, data analysts, and researchers who need to generate and manage multiple graphical outputs efficiently. It is particularly relevant for those involved in data visualization and presentation in scientific computing.

Raging Dragon
Messages
5
Reaction score
0
I have a for loop spitting out 60 graphs that I have to save to a file. I have to rename them anyways, so saving them by hand is not the issue. I'm wanting know how to maximize the screen and iteratively name the figures.

i.e. my code looks like

for i = 1:30

(stuff)

figure(i)
do more stuff

figure(100*i)
do other stuff

end

I came across this old thread https://www.physicsforums.com/showthread.php?t=187887 which was helpful, but doesn't fully answer what I want to do because:

figure(1,'Position',[0 0 1680 1050])

or

figure(1,[0 0 1680 1050])

obviously returns the error
? Error using ==> figure
Too many input arguments.
 
Physics news on Phys.org
If you do something like

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

before plotting anything then it will set the default size for new figures to be maximised.

Hope that helps :-)
 
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285121
 

Similar threads

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