R语言 怎么把两个散点图画在一起
vd2=c(-16.3,-12.2,-8.2,-3.9,0,5.9,9.7,13.2,18.1)vd1=c(-16.6,-12.5,-8.8,-4.2,0,6,9.8,1...
vd2=c(-16.3,-12.2,-8.2,-3.9,0,5.9,9.7,13.2,18.1)
vd1=c(-16.6,-12.5,-8.8,-4.2,0,6,9.8,15,18.2)
y=c(-16,-12,-8,-4,0,4,8,12,16)
plot(y~vd1)
plot(y~vd2,col="red")
怎么把这两个散点图画在一起啊? 展开
vd1=c(-16.6,-12.5,-8.8,-4.2,0,6,9.8,15,18.2)
y=c(-16,-12,-8,-4,0,4,8,12,16)
plot(y~vd1)
plot(y~vd2,col="red")
怎么把这两个散点图画在一起啊? 展开
2个回答
展开全部
可以先用plot函数建立坐标系,再在建好的坐标系里画图。
vd2=c(-16.3,-12.2,-8.2,-3.9,0,5.9,9.7,13.2,18.1)
vd1=c(-16.6,-12.5,-8.8,-4.2,0,6,9.8,15,18.2)
y=c(-16,-12,-8,-4,0,4,8,12,16)
plot(-20:20, -20:20, type = "n") #建立坐标系
points(vd1, y, col = "red")
points(vd2, y, col = "blue", cex = 1.5)
可以参考points函数的帮助文件。。
vd2=c(-16.3,-12.2,-8.2,-3.9,0,5.9,9.7,13.2,18.1)
vd1=c(-16.6,-12.5,-8.8,-4.2,0,6,9.8,15,18.2)
y=c(-16,-12,-8,-4,0,4,8,12,16)
plot(-20:20, -20:20, type = "n") #建立坐标系
points(vd1, y, col = "red")
points(vd2, y, col = "blue", cex = 1.5)
可以参考points函数的帮助文件。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询