• Uncategorised

plot

plot Linear plot.
plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix,
then the vector is plotted versus the rows or columns of the matrix,
whichever line up. If X is a scalar and Y is a vector, length(Y)
disconnected points are plotted.

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

Various line types, plot symbols and colors may be obtained with
plot(X,Y,S) where S is a character string made from one element
from any or all the following 3 columns:

y yellow . point – solid
m magenta o circle : dotted
c cyan x x-mark -. dashdot
r red + plus — dashed
g green * star
b blue s square
w white d diamond
k black v triangle (down)
^ triangle (up)
< triangle (left) > triangle (right)
p pentagram
h hexagram

For example, plot(X,Y,’c+:’) plots a cyan dotted line with a plus
at each data point; plot(X,Y,’bd’) plots blue diamond at each data
point but does not draw any line.

plot(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,…) combines the plots defined by
the (X,Y,S) triples, where the X’s and Y’s are vectors or matrices
and the S’s are strings.

For example, plot(X,Y,’y-‘,X,Y,’go’) plots the data twice, with a
solid yellow line interpolating green circles at the data points.

The plot command, if no color is specified, makes automatic use of
the colors specified by the axes ColorOrder property. The default
ColorOrder is listed in the table above for color systems where the
default is yellow for one line, and for multiple lines, to cycle
through the first six colors in the table. For monochrome systems,
plot cycles over the axes LineStyleOrder property.

plot returns a column vector of handles to LINE objects, one
handle per line.

The X,Y pairs, or X,Y,S triples, can be followed by
parameter/value pairs to specify additional properties
of the lines.

See also semilogx, semilogy, loglog, grid, clf, clc, title, xlabel,
ylabel, axis, axes, hold, colordef, legend, subplot, and stem.

You may also like...