Add a Box Around a Plot

DESCRIPTION:

Surrounds the current plot with a box of given thickness.

USAGE:

box(n=1, fill=F, ...) 

OPTIONAL ARGUMENTS:

n
number of times the box is drawn (i.e., the heaviness of the line).
fill
logical flag. Should the entire plot region be filled with a solid color ( TRUE) or just outlined ( FALSE)?

Graphical parameters may also be supplied as arguments to this function (see ). In particular the bty parameter controls the type of box, the lty parameter controls the line type used to draw the box, and the lwd parameter controls the line width (see Details below for more information).

DETAILS:

The values of the lty and lwd parameters in par are ignored. The line type and line width used to draw the box are always lty=1 and lwd=1 respectively, unless explicitly set with the box function.

SIDE EFFECTS:

a box is drawn at the usual position of the axes. The width of the box depends on the device that is being used.

SEE ALSO:

, .

EXAMPLES:

box(5, col=2)   # draw a thick color 2 box around plot 
box(fill=T, col=7)   # draw a filled box in color 7