R语言中的分屏函数

1、使用par(mfrow=c(2,2))即可 (论文中的使用方法)

[plain]  view plain  copy
  1. >par(mfrow=c(3,3))  
  2. > plot(Nile)  
  3. > plot(Nile)  
  4. > plot(Nile)  
  5. > plot(Nile)  
  6. > plot(Nile)  
  7. > plot(Nile)  
  8. > plot(Nile)  
  9. > plot(Nile)  
  10. > plot(Nile)  


将平面分成3*3的形式。

2、使用split.screen()

[plain]  view plain  copy
  1. split.screen(c(2,1))        # split display into two screens  
  2. split.screen(c(1,3), screen = 2) # now split the bottom half into 3  
  3. screen(1) # prepare screen 1 for output  
  4. plot(10:1)  
  5. screen(4) # prepare screen 4 for output  
  6. plot(10:1)  
  7. close.screen(all = TRUE)    # exit split-screen mode  
  8.   
  9.   
  10. split.screen(c(2,1))        # split display into two screens  
  11. split.screen(c(1,2),2)      # split bottom half in two  
  12. plot(1:10)                  # screen 3 is active, draw plot  
  13. erase.screen()              # forgot label, erase and redraw  


得出:

split.screen()是用来划分屏幕的函数

[plain]  view plain  copy
  1. split.screen(c(2,1))    
是将图形分成两行一列的形式,给图形的索引从左到右,从上到下依次为1,2,3的格式

screen()函数用来选择屏幕

3、用layout()函数

[html]  view plain  copy
  1. nf<-layout(matrix(c(1,2,3,4),2,2))  
  2. layout.show(nf)  


[html]  view plain  copy
  1. nf<-layout(matrix(c(1,2,3,4,5,5),2,3))  
  2.  layout.show(nf)  

c(1,2,3,4,5,5)表示图形1,2,3,4,5要画的位置


在一图上在继续作图的函数:

lines()语句,你可以为一幅现有图形添加新的图形元素。


转载来自:http://blog.youkuaiyun.com/reallocing1/article/details/41726577

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值