立即学习:https://edu.csdn.net/course/play/24913/285853?utm_source=blogtoedu
text函数
text(x,y,labels,…)
x,y是数据向量
labels可以是整数,也可以是字符串,缺省状态下,labels=1:length(x)
x <- 1:20
y <- sample(1:100, 20)
plot(x, y, type = "n")
text(x, y)
对应结果:
plot(1:5, 1:5)
text(x = c(3, 3), y = c(3, 5))
对应结果:
plot(1:5, 1:5)
text(x = c(3, 3), y = c(3, 5), labels = c("a", "b"), col = c("red", "blue"))
对应结果: