【发布时间】:2015-02-01 12:36:49
【问题描述】:
我想叠加两个图:
情节1
t1 <- c(0,1,2,3,4,5,6,7,8,9,10)
d1 <- c(0,2,4,6,8,10,12,14,16,18,20)
情节2
t2 <- c(0,1,2,3,4,5)
d2 <- c(1,3,7,8,8,8)
我试过了
plot(d1~t1, col="black", type="l")
par(new=T)
plot(d2~t2, col="black", type="l")
但问题是:这样,两个x轴也相互重叠,而plot1中的x为1:10,而plot2为1:5
【问题讨论】:
-
你是在找
plot(d1 ~ t1, type = "l") ; lines(t2, d2)
标签: r