MATLAB Figure

From ControlTheoryPro.com

Revision as of 16:32, 15 April 2013 by Gabe Spradlin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Symbol.gif
MATLAB Figure
Green carrot left.gif
All MATLAB Articles MATLAB's Plot Command
Green carrot.jpg
In order to prevent spam, users must register before they can edit or create articles.

1 Introduction

Plots are usually the best way to display data with more than a few elements. In order to plot a figure must be created (commands such as plot automatically call gcf which creates a figure if one doesn't exist). Figures are fairly straight forward, simple to use objects. The figure object is necessary for plots and GUIs. Also, figures are the only valid children of the root.

2 Basic Usage

The most basic usage of the figure command is

 >> figure

If a handle to the figure object is desired then use the following syntax

 >> h = figure;

2.1 Switching between figures

To make a specific figure the current figure use the following

 >> figure(h)

3 Properties

Like all objects in MATLAB the figure object can has properties which can be set at the time of creation or later by passing in the proper handle.

The properties I (Gabe) use the most are

  • Position
  • Name

Full list of figure properties form MATLAB

3.1 Axes

Within figures are axes which also have properties. The most common properties have their own function calls and they are list below

  • xlabel/ylabel/zlabel
  • title
  • grid on

Other common properties are

  • xlim
  • xtick
  • xticklabel
  • position

Note that any property above that starts with an x have a y and z equivalent property.