## error ellipse for a set of points
xy <- matrix(round(rnorm(100, 0, 8), 2), ncol=2)
ctr <- colMeans(xy)
covMat <- cov(xy)
plot(xy, pch=16, asp=1)
drawEllipse(ctr, covMat, radius=1, fg='blue', colCtr='blue',
lwd=2, pch=4, cex=2)
Run the code above in your browser using DataLab