\Header{abline}{Add a Straight Line to a Plot}
\keyword{aplot}{abline}
\begin{Usage}
\begin{verbatim}
abline(a, b, ...)
abline(h=, ...)
abline(v=, ...)
abline(coef=, ...)
abline(reg=, ...)
\end{verbatim}
\end{Usage}
\begin{Description}
This function adds one or more straight lines through the current plot.
The first form above specifies the line in intercept/slope form
(alternatively \texttt{a} can be specified on its own and is taken to
contain the slope and intercept in vector form).
The \texttt{h=} and \texttt{v=} forms draw horizontal and vertical lines
at the specified coordinates.
The \texttt{coef} form specifies the line by a vector containing the
slope and intercept.
\texttt{reg} is a regression object which contains \texttt{reg\$coef}.  If
it is of length 1 then the value is taken to be the slope of a line
through the origin, otherwise, the first 2 values are taken to be the
slope and intercept.

The graphical parameters \texttt{col} and \texttt{lty} can be specified as
arguments to \texttt{abline}; see \texttt{par} for details.\end{Description}
\begin{SeeAlso}
\texttt{\Link{lines}} and \texttt{\Link{segments}} for connected and
arbitrary lines given by their \emph{endpoints}.
\texttt{\Link{par}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(cars)
z <- lm(dist ~ speed, data = cars)
plot(cars)
abline(z)
\end{ExampleCode}
\end{Examples}

