I have a scatter plot created using ggplot in R:
ggplot(data, aes(x=x, y=y)) +
xlim(0,800) +
ylim(0,600) +
geom_point(colour="black") +
geom_path(aes(color="red")
I want to draw an ellipse overlaid on this plot (please, not confidence interval ellipse) using center coordinates, height, and width.
I've tried draw.ellipse
function from plotrix package, but this only works on scatterplot created by R's default plot
function.
Would anyone know how to draw an ellipse on a scatterplot created by ggplot?