MATLAB Functions Help Desk

plot

Purpose

Linear 2-D plot

Syntax

Description

plot(Y) plots the columns of Y versus their index if Y is a real number. If Y is complex, plot(Y) is equivalent to plot(real(Y),imag(Y)). In all other uses of plot, the imaginary component is ignored.

plot(X1,Y1,...) plots all lines defined by Xn versus Yn pairs. If only Xn or Yn is a matrix, the vector is plotted versus the rows or columns of the matrix, depending whether the vector's row or column dimension matches the matrix.

plot(X1,Y1,LineSpec,...) plots all lines defined by the Xn,Yn,LineSpec triples, where LineSpec is a line specification that determines line type, marker symbol, and color of the plotted lines.

plot(...,'PropertyName',PropertyValue,...) sets properties to the specified property values for all Line graphics objects created by plot.

h = plot(...) returns a column vector of handles to Line graphics objects, one handle per Line.

Remarks

If you do not specify a color when plotting more than one line, plot automatically cycles through the colors and line styles in the order specified by the current Axes.

You can mix Xn,Yn,LineSpec triples with Xn,Yn pairs, for example,

Examples

plot(X,Y,'c+') plots a cyan-colored plus sign at each data point.

plot(X,Y,'r-',X,Y,'go') plots a solid red line connecting the data points and green circles showing the location of each data point.

The statements

produce

See Also

axis, grid, line, LineSpec, loglog, plotyy, semilogx, semilogy



[ Previous | Help Desk | Next ]