The **plot** command suffices for basic 2-D graphics. If *x* and *y*
are equal-length vectors, **plot(x, y)** will plot the values of *y* on
the y-axis versus those of *x* on the x-axis. If the first argument is
omitted, it will be taken to be the indices of *y* -- that is,
1:*n* where *n* is the length of y. Since graphs usually begin at zero,
and MATLAB indexes from one, this is rarely wanted. If *y* has *n*
elements, **plot(0: n-1, y)** may be more appropriate.
A frequent usage is the form

To change the style of the lines, put in a third argument, in single quotes.
E.g. **plot(x, y, '-')** specifies a solid line (the default). `'-'` is
a dashed line, `':'` dotted, `'-.'` alternating dots and dashes.
To plot only the data points and not draw lines between them, put `'.'`
(points), `'+'` (crosses), `' '` (stars), `'o'` (circles),
or `'x'` (x's).

To specify a color, give the appropriate letter in single quotes as a
third argument. To specify both color and line style, give both (in that
order) as a single single-quoted argument, with no spaces; e.g. `'b:'`
is a blue dashed line. Available colors are white (w), black (k),
red (r), green (g), blue (b), cyan (c), magenta (m), and yellow (y).

To put multiple pictures in the same graph window, simply give all their
arguments to a single **plot**. E.g. **plot(x1, y1, x2, y2)** plots
*x*1 versus *y*1 and *x*2 versus *y*2. **plot(x1, y1, 'b:', x2, y2)**
does the same, but with the former as a dotted blue curve.

For multiple
nonoverlapping plots in one window, use **subplot( x, y, n)**,
where

For multiple figure windows, **figure n** will make the

Use **clf** and **cla** to clear the current figure or axes.

Replacing **plot** with **loglog**, **semilogx**, or **semilogy**
produces a plot that is logarithmic in both axes, the x axis, or the y
axis, respectively (non-logarithmic axes remaining linear). For other
kinds of plots, use **help** on **polar**, **bar**, **hist**,
**quiver**, **compass**, **feather**, **rose**, **stairs**,
**fill**.

Both **xlabel** and **ylabel** take a text string (in single quotes)
and use it to label the appropriate axis. Similarly **title** uses
its text string argument as the graph's title. To place text arbitrarily,
use **gtext** to place via mouse and **text** to place via specifying
coordinates -- **help** for details. Use **grid** to get gridlines.
Stylized versions are available as **stext**, **sxlabel**, **stitle**,
etc (see **help**).

You can *find* the coordinates of a series of points with **ginput**
by clicking with the mouse.

MATLAB will auto-scale the axes by default, using the minimum and maximum
values of the data given to it for each axis. To examine or change this
behavior, use **axis**. **axis( xmin, xmax, ymin, ymax)** sets
the limits.

Given a function, **fplot(' function name', [xmin xmax])**
will plot the function in the given range; this can offer a more convenient
way to view a MATLAB-defined or M-file function than constructing vectors
of values by hand. See

Also see **help plotxy**.

Sat Mar 21 21:42:28 EST 1998