Text 一个图中有两个文本图

Text 一个图中有两个文本图,text,plot,Text,Plot,我一直在尝试在R中使用textplot,不确定我的问题是否可行,我知道par()不能用于在一个绘图中放置两个textplot。我一直在使用一个页面和这段代码来尝试解决问题 我的问题是:是否可能在同一个图中有两个文本图? 例如,在下面的par(mfrow=c(1,1))场景中,图1是物种长度的特克斯图。假设我想在那个图中复制那个文本图两次。可能吗 根据本网站: textplot(版本) 数据(iris) par(mfrow=c(1,1)) 信息也许你在过去的四个月里已经弄明白了,但我想我还是要插

我一直在尝试在R中使用textplot,不确定我的问题是否可行,我知道par()不能用于在一个绘图中放置两个textplot。我一直在使用一个页面和这段代码来尝试解决问题

我的问题是:是否可能在同一个图中有两个文本图? 例如,在下面的par(mfrow=c(1,1))场景中,图1是物种长度的特克斯图。假设我想在那个图中复制那个文本图两次。可能吗

根据本网站:

textplot(版本)
数据(iris)
par(mfrow=c(1,1))

信息也许你在过去的四个月里已经弄明白了,但我想我还是要插嘴回答

所提供的代码是实现您所需功能的大部分方法,您只需向
title()
和/或
par()
提供一些额外的输入即可。也就是说,通过使用
title(“您的title”,outer=TRUE)
指定标题位于两个图的上方,您可以使用
par()中的选项进一步调整标题的位置,使用
par(mfrow=c(2,1),oma=c(0,0,“top”,0))
。希望这能回答你的问题

require('gplots')

data(iris)

info <- sapply(split(iris$Sepal.Length, iris$Species), 
           function(x) round(c(Mean = mean(x), SD = sd(x), N = gdata::nobs(x)),2))

## Replace top with a numerical value to control the position of the title with respect to the
## top of the page.
par(mfrow = c(2,1), oma = c(0,0, top ,0))

textplot(info, valign = "top")
textplot(info, valign = "top")

title("Sepal Length by Species", outer = TRUE)
require('gplots'))
数据(iris)
信息
require('gplots')

data(iris)

info <- sapply(split(iris$Sepal.Length, iris$Species), 
           function(x) round(c(Mean = mean(x), SD = sd(x), N = gdata::nobs(x)),2))

## Replace top with a numerical value to control the position of the title with respect to the
## top of the page.
par(mfrow = c(2,1), oma = c(0,0, top ,0))

textplot(info, valign = "top")
textplot(info, valign = "top")

title("Sepal Length by Species", outer = TRUE)