备注:学习备忘
1、使用par(mfrow=c(2,2))即可
- >par(mfrow=c(3,3))
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
- > plot(Nile)
将平面分成3*3的形式。
2、使用split.screen()
- split.screen(c(2,1)) # split display into two screens
- split.screen(c(1,3), screen = 2) # now split the bottom half into 3
- screen(1) # prepare screen 1 for output
- plot(10:1)
- screen(4) # prepare screen 4 for output
- plot(10:1)
- close.screen(all = TRUE) # exit split-screen mode
-
-
- split.screen(c(2,1)) # split display into two screens
- split.screen(c(1,2),2) # split bottom half in two
- plot(1:10) # screen 3 is active, draw plot
- erase.screen() # forgot label, erase and redraw
得出:
split.screen()是用来划分屏幕的函数
是将图形分成两行一列的形式,给图形的索引从左到右,从上到下依次为1,2,3的格式
screen()函数用来选择屏幕
3、用layout()函数
- nf<-layout(matrix(c(1,2,3,4),2,2))
- layout.show(nf)
- nf<-layout(matrix(c(1,2,3,4,5,5),2,3))
- layout.show(nf)
c(1,2,3,4,5,5)表示图形1,2,3,4,5要画的位置
在一图上在继续作图的函数:
lines()语句,你可以为一幅现有图形添加新的图形元
素。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。