\Header{plot.default}{The Default Scatterplot Function}
\keyword{hplot}{plot.default}
\begin{Usage}
\begin{verbatim}
plot.default(x, y = NULL, type = "p",  xlim = NULL, ylim = NULL,
             log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
             ann = par("ann"), axes = TRUE, frame.plot = axes,
             panel.first = NULL, panel.last = NULL,
             col = par("fg"), bg = NA, pch = par("pch"),
             cex = par("cex"), lty = par("lty"), lwd = par("lwd"),
             asp = NA, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x,y}] the \texttt{x} and \texttt{y} arguments provide the x and y
coordinates for the plot.  Any reasonable way of defining the
coordinates is acceptable.  See the function \texttt{\Link{xy.coords}}
for details.
\item[\texttt{type}] the type of plot desired.  The following possibilities are
possible; \texttt{"p"} for points, \texttt{"l"} for lines, \texttt{"o"}
for overplotted points and lines, \texttt{"b"} or \texttt{c} for points
joined by lines, \texttt{"s"} and \texttt{"S"} for step functions and
\texttt{"h"} for \emph{high density} vertical lines.
\item[\texttt{xlim}] the x limits (min,max) of the plot.
\item[\texttt{ylim}] the y limits of the plot.
\item[\texttt{log}] a character string which contains \texttt{"x"} if the x axis
is to be logarithmic, \texttt{"y"} if the y axis is to be logarithmic
and \texttt{"xy"} or \texttt{"yx"} if both axes are to be logarithmic.
\item[\texttt{main}] a main title for the plot.
\item[\texttt{sub}] a sub title for the plot.
\item[\texttt{xlab}] a label for the x axis.
\item[\texttt{ylab}] a label for the y axis.
\item[\texttt{ann}] an logical value indicating whether the default annotation
(title and x and y axis labels) should appear on the plot.
\item[\texttt{axes}] a logical value indicating whether axes should be drawn on
the plot.
\item[\texttt{frame.plot}] a logical indicating whether a box should be drawn
around the plot.
\item[\texttt{panel.first}] an expression to be evaluated after the plot axes
are set up but before any plotting takes place.  This can be useful
for drawing background grids or scatterplot smooths.
\item[\texttt{panel.last}] an expression to be evaluated after plotting has
taken place.
\item[\texttt{col}] The colors for lines and points.  Multiple colors can be
specified so that each point can be given its own color.  If there
are fewer colors than points they are recycled in the standard
fashion.
\item[\texttt{bg}] background color of ???
\item[\texttt{pch}] a vector of plotting characters or symbols.
\item[\texttt{cex}] a numerical value giving the amount by which plotting text
and symbols should be scaled relative to the default
\item[\texttt{lty}] the line type, see \texttt{\Link{par}}.
\item[\texttt{lwd}] the line width \bold{not yet supported for postscript}.
\item[\texttt{asp}] the \eqn{y/x}{} aspect ratio, see \texttt{\Link{plot.window}}.
\item[\texttt{...}] graphical parameters as in \texttt{\Link{par}(...)} may
also be passed as arguments.
\end{ldescription}
\end{Arguments}
\begin{Description}
Draw a scatter plot with ``decorations'' such as axes and titles
in the active graphics window.\end{Description}
\begin{References}
Cleveland, W. S. (1985).
\emph{The Elements of Graphing Data}.
Monterey, CA: Wadsworth.\end{References}
\begin{SeeAlso}
\texttt{\Link{plot}}, \texttt{\Link{plot.window}}, \texttt{\Link{xy.coords}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(cars)
Speed <- cars$speed
Distance <- cars$dist
plot(Speed, Distance, panel.first = grid(8,8),
     pch = 0, cex = 1.2, col = "blue")
plot(Speed, Distance,
     panel.first = lines(lowess(Speed, Distance), lty = "dashed"),
     pch = 0, cex = 1.2, col = "blue")

##--- Log-Log Plot  with  custom axes
lx <- seq(1,5, length=41)
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
y <- exp(-.5*lx^2)
op <- par(mfrow=c(2,1), mar=par("mar")+c(0,1,0,0))
plot(10^lx, y, log="xy", type="l", col="purple",
     main="Log-Log plot", ylab=yl, xlab="x")
plot(10^lx, y, log="xy", type="o", pch='.', col="forestgreen",
     main="Log-Log plot with custom axes", ylab=yl, xlab="x",
     axes = FALSE, frame.plot = TRUE)
axis(1, at = my.at <- 10^(1:5), labels = formatC(my.at, format="fg"))
at.y <- 10^(-5:-1)
axis(2, at = at.y, labels = formatC(at.y, format="fg"), col.axis="red")
par(op)
\end{ExampleCode}
\end{Examples}

