shotGroups (version 0.1)

drawBox: Draw an axis-aligned box

Description

Adds an axis-aligned box to an already opened plot.

Usage

drawBox(xleft, ybottom, xright, ytop, fg = par('fg'), bg = NA,
        colCtr = NA, lty = par('lty'), lwd = par('lwd'),
        pch = par('pch'), cex = par('cex'))

Arguments

xleft
a vector (or scalar) of left x positions.
ybottom
a vector (or scalar) of bottom y positions.
xright
a vector (or scalar) of right x positions.
ytop
a vector (or scalar) of top y positions.
fg
color of the box' rim.
bg
color of 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 symbol used for the center of the box.

Details

This function is mainly a wrapper for rect.

See Also

getBoundingBox, rect

Examples

Run this code
xy <- matrix(round(rnorm(20, 100, 15), 1), ncol=2)
bb <- getBoundingBox(xy)
plot(xy, asp=1, pch=16)
drawBox(bb$pts[1], bb$pts[2], bb$pts[3], bb$pts[4],
        fg='blue', colCtr='blue', pch=4, cex=2)

Run the code above in your browser using DataLab