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