MATLAB Functions | Help Desk |
plot
Linear 2-D plotplot(Y)
plot(X1,Y1,...)
plot(X1,Y1,LineSpec
,...)
plot(...,'PropertyName',PropertyValue,...)
h = plot(...)
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.
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,
plot(X1,Y1,X2,Y2,LineSpec
,X3,Y3)
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
x = -pi:pi/500:pi;
y = tan(sin(x)) - sin(tan(x));
plot(x,
y)
produce axis
, grid
, line
, LineSpec
, loglog
, plotyy
, semilogx
, semilogy