drawBox: Draw an axis-aligned box

View source: R/draw.R

drawBoxR Documentation

Draw an axis-aligned box

Description

Adds an axis-aligned box to an existing plot.

Usage

drawBox(x, fg = par('fg'), bg = NA,
        colCtr = NA, lty = par('lty'), lwd = par('lwd'),
        pch = par('pch'), cex = par('cex'))

## S3 method for class 'list'
drawBox(x, fg = par('fg'), bg = NA,
        colCtr = NA, lty = par('lty'), lwd = par('lwd'),
        pch = par('pch'), cex = par('cex'))

## Default S3 method:
drawBox(x, fg = par('fg'), bg = NA,
        colCtr = NA, lty = par('lty'), lwd = par('lwd'),
        pch = par('pch'), cex = par('cex'))

Arguments

x

either a list with component pts as returned by getBoundingBox, or a vector giving coordinates xleft, ybottom, xright, ytop.

fg

color of the box' rim.

bg

the box' fill color. Set to NA for a fully transparent box.

colCtr

color of the center point. Set to NA to omit.

lty

line type of the box.

lwd

line width of the box.

pch

symbol used for the center of the box.

cex

magnification factor for the symbol used for the center of the box.

Details

This function is mainly a wrapper for rect.

See Also

getBoundingBox, rect

Examples

xy  <- matrix(round(rnorm(20, 100, 15), 1), ncol=2)
(bb <- getBoundingBox(xy))

plot(xy, asp=1, pch=16)
drawBox(bb, fg='blue', colCtr='blue', pch=4, cex=2)

shotGroups documentation built on Sept. 18, 2022, 1:08 a.m.