R 如何在同一個介面畫出多張圖形_圖片顯示

來源:互聯網
上載者:User

1) par()函數的使用
par(mfcol=c(2,3)) 是將介面分為2*3 個繪圖區域即是 2行3列 而
mfcol 中的col是按照列優先的順序進行填充。
那麼mfrow就是以行優先的順序進行映像填充。
以下是測試的代碼集合圖片

hist(rnorm(25),col="red",main="red")hist(rnorm(19),col="green",main="b")hist(rnorm(50),col="blue",main="c")hist(rnorm(60),col="pink",main="d")```![利用par(mfcol=c(2,3)) 實現的介面分割,可以在同一個介面同時顯示多張圖片](https://img-blog.csdn.net/20160807165404043)2)layout()函數 layout()函數有一個優點:可以指定圖片的位置<div class="se-preview-section-delimiter"></div>```layout(matrix(c(2,3,4,1),nr=2,byrow=T))            hist(rnorm(25),col="red",main="a")            hist(rnorm(25),col="blue",main="b")            hist(rnorm(25),col="pink",main="c")            hist(rnorm(25),col="green",main="d")

            hist(rnorm(25),col="red",main="a")            hist(rnorm(25),col="blue",main="b")            hist(rnorm(25),col="pink",main="c")            hist(rnorm(25),col="green",main="d")


3)split.screen()
split.screen(c(3,2))的意思是可以將介面分為3行兩列的格式,可以使3*2張圖形在同一個介面出現

這裡寫代碼片

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.