我有四个时间序列,我想绘制,最好使用基本图形。绘制覆盖时间系列
year<-c(2000,2001,2002,2003,2004,2005,2006,2007) #x axis
a<-c(36.2,42.4,43.4,56.4,67.4,42.4,22.4,20.4)
b<-c(NA,NA,NA,56.4,67.4,42.4,22.4,20.4)
c<-c(36.4,42.3,43.7,56.4,67.2,88.3,99.3,99.9)
d<-c(36.4,42.3,43.7,56.4,NA,NA,NA,NA)
#using different thickness of lines to distinguish between them? Dunno
par(mar = c(4,4,4,4))
par(mfrow=c(1,2))
plot(year,a, xlab="Year", ylab="Whatever", type="l", lwd=6, ylim=c(20, 100))
lines(year,b, type="l", lwd=2, col="yellow")
plot(year,c, xlab="Year", ylab="Whatever", type="l", lwd=6, ylim=c(20, 100))
lines(year,d, type="l", lwd=2, col="yellow")
正如你所看到的,二分之一的系列始终是其中另一系列A和B的子集,在他们开始非常相似,所以它不会在一个情节好看(这个特性)。 你有任何建议如何绘制这种数据?我不介意在一个情节中拥有这一切,但这不是必要的。 干杯。
有什么办法如何把它们彼此相邻?我尝试了'rbind'而不是'cbind',它不起作用。 – Vochmelka
@Vochmeika,'plot.zoo'参数'nc = 2'会将面板绘制成两列而不是一列。 –