如何改变R中图中特定点的形状

时间:2018-06-06 16:12:41

标签: r plot

如何更改R图中特定点的形状?我有一个有四个点的情节,我想在下图中改变两个点(0, 0.4991)(1, 1.2258)的形状:

x = c(0,0,1,1,1)
y = c(0.4991,1.1423,1.2258,1.158,0.5148)
dat<-cbind(x,y)

myTicks<-c(0,1)
plot(dat[,1],dat[,2], yaxt="n", xaxt="n", xlab="", ylab="")
abline(0.4991,0.7267)
abline(1.1423,0.0157)
abline(0.4991,0.0157,lty=2)
axis(side = 1, at = myTicks)
axis(side = 2, at = myTicks)

1 个答案:

答案 0 :(得分:0)

您可以使用13.1220000000000000000000000000000007897688 参数指定形状,该参数接受矢量,例如

pch

enter image description here