3 回答

TA貢獻1770條經驗 獲得超3個贊
該格子包往往(但并不總是)忽略相提并論命令,所以我繪制W /時只需避免使用它格。
要將多個點陣圖放在一個頁面上:
創(chuàng)建(但不繪制)晶格/格子圖對象,然后
為每個圖調用一次打印
對于每個打印調用,請傳遞(i)繪圖的參數;(ii) more,設置為TRUE,并且僅在首次調用print時才傳入,以及(iii)pos,其給出頁面上每個圖的位置,指定為圖的左下角的xy坐標對角和右上角,分別是具有四個數字的向量。
顯示起來比說起來容易得多:
data(AirPassengers) # a dataset supplied with base R
AP = AirPassengers # re-bind to save some typing
# split the AP data set into two pieces
# so that we have unique data for each of the two plots
w1 = window(AP, start=c(1949, 1), end=c(1952, 1))
w2 = window(AP, start=c(1952, 1), end=c(1960, 12))
px1 = xyplot(w1)
px2 = xyplot(w2)
# arrange the two plots vertically
print(px1, position=c(0, .6, 1, 1), more=TRUE)
print(px2, position=c(0, 0, 1, .4))
- 3 回答
- 0 關注
- 562 瀏覽
添加回答
舉報