12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

subplotPurpose2subplotCreate and control multiple axesSyntaxDescriptionsubplot(m,n,p)subplot(h)subplot('Position',[left bottom width height])h = subplot(...)subplot divides the current figure into rectangular panes that are numberedrow-wise. Each pane contains an axes. Subsequent plots are output to thecurrent pane.subplot(m,n,p) creates an axes in the p-th pane of a figure divided into anm-by-n matrix of rectangular panes. The new axes becomes the current axes.subplot(h) makes the axes with handle h current for subsequent plottingcommands.subplot('Position',[left bottom width height]) creates an axes at theposition specified by a four-element vector. left, bottom, width, and heightare in normalized coordinates in the range from 0.0 to 1.0.h = subplot(...) returns the handle to the new axes.RemarksIf 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 axesobjects and returns to the default subplot(1,1,1) configuration.You can omit the parentheses and specify subplot as.subplot mnpwhere m refers to the row, n refers to the column, and p specifies the pane.Special Case – subplot(111)The command subplot(111) is not identical in behavior to subplot(1,1,1)and exists only for compatibility with previous releases. This syntax does notimmediately create an axes, but instead sets up the figure so that the nextgraphics command executes a clf reset (deleting all figure children) andcreates a new axes in the default position. This syntax does not return a2-464

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!