1

I have a scatterplot in a rectangle 10 by 10 (says) and I want to draw a circle with radius = 3 around each point in this scatterplot. Do you have any idea about it ?

Thank you all.

Math
  • 1,274
  • 3
  • 14
  • 32

2 Answers2

5

If you want both scatter points and circles of a given size (relative to the x-axis coordinates or actual size in inches/cm) I suggest you use the symbols() function

x <- 10*runif(4)
y <- 10*runif(4)
symbols(x, y, circles=rep(3, length(x)), inches=FALSE,
        xlim=c(0,10), ylim=c(0,10))
points(x, y, pch=19)

enter image description here

Backlin
  • 14,612
  • 2
  • 49
  • 81
  • You're welcome! Just note that if you resize the figure, the circles will not turn into ellipses but just rescale according to the x-axis. – Backlin Jan 12 '15 at 16:42
3
plot(10*runif(10),10*runif(10),cex=10)
Dieter Menne
  • 10,076
  • 44
  • 67