\HeaderA{box}{Draw a Box around a Plot}{box}
\keyword{aplot}{box}
\begin{Description}\relax
This function draws a box around the current plot in the given color
and linetype.  The \code{bty} parameter determines
the type of box drawn.  See \code{\LinkA{par}{par}} for details.
\end{Description}
\begin{Usage}
\begin{verbatim}
box(which = "plot", lty = "solid", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{which}] character, one of \code{"plot"}, \code{"figure"},
\code{"inner"} and \code{"outer"}.
\item[\code{lty}] line type of the box.
\item[\code{...}] further graphical parameters, such as \code{bty},
\code{col}, or \code{lwd}, see \code{\LinkA{par}{par}}.  Note that
\code{xpd} is not accepted as clipping is always to the device
region.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The choice of colour is complicated.  If \code{col} was supplied
and is not \code{NA}, it is used.  Otherwise, if \code{fg} was supplied
and is not \code{NA}, it is used.  The final default is \code{par("col")}.
\end{Details}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{rect}{rect}} for drawing of arbitrary rectangles.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
plot(1:7, abs(stats::rnorm(7)), type = 'h', axes = FALSE)
axis(1, at = 1:7, labels = letters[1:7])
box(lty = '1373', col = 'red')
\end{ExampleCode}
\end{Examples}

