我發現了一些在線的答案,但由於某些原因,我解釋不正確,因爲我無法讓它工作。我的目標是簡單地使用xts
繪圖功能(用它創建的方式軸,網格線等)來繪製多條曲線:在一個窗口中繪製多重文本對象
x <- xts(data.frame(a=1:100, b=100:1),seq(from=as.Date("2010-01-01"), by="days", len=100))
> plot(x, screens=1)
Warning messages:
1: In plot.xts(x, screens = 1) :
only the univariate series will be plotted
2: In plot.window(...) : "screens" is not a graphical parameter
3: In plot.xy(xy, type, ...) : "screens" is not a graphical parameter
4: In axis(1, at = xycoords$x, labels = FALSE, col = "#BBBBBB", ...) :
"screens" is not a graphical parameter
5: In axis(1, at = xycoords$x[ep], labels = names(ep), las = 1, lwd = 1, :
"screens" is not a graphical parameter
6: In axis(2, ...) : "screens" is not a graphical parameter
7: In title(screens = 1) : "screens" is not a graphical parameter
闖闖:
> plot(x, plot.type="single")
Warning messages:
1: In plot.xts(x, plot.type = "single") :
only the univariate series will be plotted
2: In plot.window(...) : "plot.type" is not a graphical parameter
3: In plot.xy(xy, type, ...) : "plot.type" is not a graphical parameter
4: In axis(1, at = xycoords$x, labels = FALSE, col = "#BBBBBB", ...) :
"plot.type" is not a graphical parameter
5: In axis(1, at = xycoords$x[ep], labels = names(ep), las = 1, lwd = 1, :
"plot.type" is not a graphical parameter
6: In axis(2, ...) : "plot.type" is not a graphical parameter
7: In title(plot.type = "single") :
"plot.type" is not a graphical parameter
要清楚:我可以使用lines
來做到這一點,但我想知道是否有辦法一次完成。
在最新版本的'xtsExtra'它警告'xtsExtra :: plot.xts'已被棄用,並使用'xts :: plot .xts',但是'xts :: plot.xts'仍然無法處理多個時間序列,而'xtsExtra :: plot.xts'實際上並不產生一個圖。 – tchakravarty