How can I render the value of points in a
plot in the
b0 = 2.5; b1 = 2 n = 100 x = rnorm(n, 20, 15) y = b0 + b1*x + rnorm(n, 0, 15) plot(x, y) plot(x, y, type='n') text(x, y, round(y, 2), cex=0.45) text(x, y, round(y, 2), cex=0.8) text(x, y, paste(round(x, 2), round(y, 2), sep=", "), cex=0.8) # for (x, y), but this gets cluttered.
cex for character size (see help for text). And use
plot(x, y, type='n') to set up your window correctly without actually plotting anything.
plot(1:10, 1:10) text(5, 5, "Foo")
help(text) for options on placing the text. The function is vectorised so you can
also do something akin to
text(1:10, 1:10, LETTERS[1:10])
if you have vectors of text and positions.