MATLAB Functions Help Desk

subplot

Purpose

Create and control multiple Axes

Syntax

Description

subplot divides the current Figure into rectangular panes that are numbered row-wise. Each pane contains an Axes. Subsequent plots are output to the current pane.

subplot(m,n,p) creates an Axes in the p-th pane of a Figure divided into an m-by-n matrix of rectangular panes. The new Axes becomes the current Axes.

subplot(h) makes the Axeswith handle h current for subsequent plotting commands.

subplot('Position',[left bottom width height]) creates an Axes at the position specified by a four-element vector. left, bottom, width, and height are in normalized coordinates in the range from 0.0 to 1.0.

h = subplot(...) returns the handle to the new Axes.

Remarks

If a subplot specification causes a new Axes to overlap an existing Axes, subplot deletes the existing Axes. subplot(1,1,1) or clf deletes all Axes objects and returns to the default subplot(1,1,1) configuration.

Examples

To plot income in the top half of a Figure and outgo in the bottom half,

See Also

axes, cla, clf, figure, gca



[ Previous | Help Desk | Next ]