\Header{plot}{Generic X-Y Plotting}
\keyword{hplot}{plot}
\begin{Usage}
\begin{verbatim}
plot(x, ...)
plot(x, y, xlim=range(x), ylim=range(y), type="p",
        main, xlab, ylab, ...)
plot(y ~ x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] the coordinates of points in the plot. Alternatively, a
single plotting structure or \emph{any \R\ object with a
\texttt{plot} method} can be provided.
\item[\texttt{y}] the y coordinates of points in the plot, \emph{optional}
if \texttt{x} is an appropriate structure.
\item[\texttt{xlim, ylim}] the ranges to be encompassed by the x and y axes.
\item[\texttt{type}] what type of plot should be drawn. Possible types are
\Itemize{
\item \texttt{"p"} for \bold{p}oints,
\item \texttt{"l"} for \bold{l}ines,
\item \texttt{"b"} for \bold{b}oth,
\item \texttt{"o"} for both ``\bold{o}verplotted'',
\item \texttt{"h"} for ``\bold{h}istogram'' like vertical lines,
\item \texttt{"s"} for \bold{s}teps,
\item \texttt{"S"} for other \bold{s}teps,
\item \texttt{"n"} for no plotting.
}

\item[\texttt{main}] an overall title for the plot.
\item[\texttt{xlab}] a title for the x axis.
\item[\texttt{ylab}] a title for the y axis.
\item[\texttt{...}] graphical parameters can be given as arguments to
\texttt{plot}.
\end{ldescription}
\end{Arguments}
\begin{Description}
Generic function for plotting of \R\ objects.  For more details about
the graphical parameter arguments, see \texttt{\Link{par}}.\end{Description}
\begin{Details}
For simple scatter plots, \texttt{\Link{plot.default}} will be used.
However, there are \texttt{plot} methods for many \R\ objects,
including \texttt{\Link{function}}s, \texttt{\Link{data.frame}}s,
\texttt{\Link{density}} objects, etc.  Use \texttt{methods(plot)} and
the documentation for these.\end{Details}
\begin{SeeAlso}
\texttt{\Link{plot.default}}, \texttt{\Link{plot.formula}} and other
methods; \texttt{\Link{points}}, \texttt{\Link{lines}}, \texttt{\Link{par}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(cars)
plot(cars)
lines(lowess(cars))

plot(sin, -pi, 2*pi)

## Discrete Distribution Plot:
plot(table(rpois(100,5)), type = "h", col = "red", lwd=10,
     main="rpois(100,lambda=5)")
\end{ExampleCode}
\end{Examples}

