shotGroups (version 0.1)

drawBox2: Draw an oriented box

Description

Adds an oriented box to an already opened plot.

Usage

drawBox2(pts, fg = par('fg'), bg = NA, colCtr = NA,
         lty = par('lty'), lwd = par('lwd'), pch = par('pch'),
         cex = par('cex'))

Arguments

pts
a numerical (4 x 2)-matrix giving the (x,y)-coordinates of the ordered box vertices.
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 polygon.

See Also

getMinBBox, polygon

Examples

Run this code
xy <- matrix(round(rnorm(20, 100, 15), 1), ncol=2)
bb <- getMinBBox(xy)
plot(xy, xlim=range(c(xy[ , 1], bb$pts[ , 1])),
         ylim=range(c(xy[ , 2], bb$pts[ , 2])), asp=1, pch=16)
drawBox2(bb$pts, fg='blue', colCtr='blue', pch=4, cex=2)

Run the code above in your browser using DataLab