簡體   English   中英

R中倍數圖的單獨標題

[英]seperate titles of multiples plots in R

我用par(mfrow = c(2,5), oma = c(0,0,2,2))在兩行中繪制5個箱線圖par(mfrow = c(2,5), oma = c(0,0,2,2))

par(mfrow = c(2,5),oma = c(0, 2, 2, 0))
boxplot(x,...)
title (main = "title1", outer = T)
boxplot(y,...)
title (main = "title2", outer = T)#overwrites title 1

如何將title2放在框線的第二行上方?

您可以使用mtext在任意位置繪制標題。

data("mtcars")
par(mfrow = c(2,5),oma = c(0, 2, 2, 0))
replicate(10,boxplot( mpg~cyl,mtcars))
mtext("title1",line = 0,outer=T,font = 2)
mtext("title2",line = -24,outer=T,font = 2)

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM