set.seed(123)
z <- complex(real = runif(50), imaginary = runif(50))
mz <- mean(z)
z <- z[order(Arg(z - mz))]
plot(z, axes = FALSE, ann = FALSE)
segments(Re(mz), Im(mz), Re(z), Im(z))
abline(h = Im(mz), v = Re(mz), lwd = 0.5)
box()
text(Re(z), Im(z), pos = avoid(z), cex = 0.7, offset = 0.25,
col = "red", font = 2, xpd = NA)
Run the code above in your browser using DataLab