Matlab Figures Demystified

Tuesday, April 20, 2010
Matlab uses object oriented structures to define graphics objects. Figures, axes and UIcontrols are referred as Handle Graphics Objects. A simple hierarchy to have in mind is:
Figure>
                Axes>
                                Image, plot, scatter, line, etc
                UIobjects>
                                Menus, panels, toolbars, etc
In general to create a figure you use a handle (figure’s name that Matlab recognize) and the name of the figure (that is printed in window’s title bar).
 
fig_1 = figure('Name', ‘name-of-the-figure-1’);
You can add options, as:
fig_1 = figure('Name', ‘name-of-the-figure-1‘, 'NumberTitle', 'off', 'menubar', 'none');
You can create more than one figure:
fig_2 = figure('Name', ‘name-of-the-figure-2‘, 'NumberTitle', 'off', 'menubar', 'none');
You can select in witch figure to plot (or how to make a figure the active figure):
Figure(fig_1);
And you can clear the contents of a figure in order to plot something different inside (from an image to an animation):
clf;

More tips comming... 

No comments:

Post a Comment

 
Copyright © Synaptic Activity
Blogger Theme by BloggerThemes Sponsored by Busy Buzz Blogging