# plot an ellipse in R library(car) help(ellipse) # see also here https://stats.stackexchange.com/questions/8504/help-in-drawing-confidence-ellipse # ellipse given by formula ((x,y) - (x0,y0)).S^(-1).((x,y)-(x0,y0))^T == r^2 x0 = 1 y0 = 2 r = .2 S = matrix(c(2,1.2,1.2,1),nrow=2) plot(x0,y0,type="n") ellipse(c(x0,y0), shape = S, radius = r) # verify that this is truly the desired ellipse abline(v=x0,lty=3) points(rep(x0,2),y0+c(-1,1)*r/sqrt(solve(S)[2,2]),pch=16) abline(h=y0,lty=3) points(x0+c(-1,1)*r/sqrt(solve(S)[1,1]), rep(y0,2),pch=16)