如何组合R中的两个图? [英] How to combine two plots in R?
本文介绍了如何组合R中的两个图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
a < - >我正在尝试组合两个图,但是我的代码不起作用, runif(10,1,5)
b< - runif(10,1,5)
c< - runif(10,1,5)
d< - runif(10,1 ,5)
plot(a,b,pch = 2)
plot(c,d,add = TRUE)
任何想法如何解决这个问题?
解决方案
使用
a< - runif(10,1, 5)
b< - runif(10,1,5)
c< - runif(10,1,5)
d< - runif(10,1,5)
图(a,b,pch = 2,xlab =a | c,ylab =b | d)
点(c,d,col =blue)
I am trying to combine two plots but my code does not work and here is my code.
a <- runif(10,1,5)
b <- runif(10,1,5)
c <- runif(10,1,5)
d <- runif(10,1,5)
plot(a,b,pch=2)
plot(c,d,add=TRUE)
Any idea how to fix this?
解决方案
Use the points
function for your second "layer":
a <- runif(10,1,5)
b <- runif(10,1,5)
c <- runif(10,1,5)
d <- runif(10,1,5)
plot(a, b, pch=2, xlab = "a | c", ylab = "b | d")
points(c, d, col="blue")
这篇关于如何组合R中的两个图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文