My question is two fold:
1) Is it possible to place a circle around specific data points on a scatter plot in R?
2) If so, how would I place separate circles of a defined radius around (5, 6) and (18, 23) given the following data.
x <- c(2, 5, 7, 9, 12, 16, 18, 21)
y <- c(3, 6, 10, 13, 15, 19, 23, 25)
plot(x, y)
(NB: This is not a request to colour specific data points on the plot, but to place a circle around them)
Check out the ?symbols
help page for drawing circles
x <- c(2, 5, 7, 9, 12, 16, 18, 21)
y <- c(3, 6, 10, 13, 15, 19, 23, 25)
plot(x, y)
symbols(x=c(5,18), y=c(6,23), circles=rep(1,2), add=T, inches=F)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With