box {graphics} | R Documentation |
Draw a Box around a Plot
Description
This function draws a box around the current plot in the given color
and line type. The bty
parameter determines
the type of box drawn. See par
for details.
Usage
box(which = "plot", lty = "solid", ...)
Arguments
which |
character, one of |
lty |
line type of the box. |
... |
further graphical parameters, such as |
Details
The choice of colour is complicated. If col
was supplied
and is not NA
, it is used. Otherwise, if fg
was supplied
and is not NA
, it is used. The final default is par("col")
.
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
rect
for drawing of arbitrary rectangles.
Examples
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')
[Package graphics version 4.4.0 Index]