mirt 图中的字体大小

问题描述

我正在尝试增加 mirt 图中的字体大小,但是,到目前为止,我只能增加刻度的大小:

library(mirt)
x <- mirt(Science,1,SE=TRUE)
plot(x)

plot(x,scales = list(cex = c(1.4)))

如何增加轴和主标题的大小?我尝试添加 xlab = list(cex = 1.4),但出现错误:

Error in xyplot.formula(score ~ Theta,plt,ylim = c(sum(mins) - ybump_full,: 
  formal argument "xlab" matched by multiple actual arguments

**编辑:** 某些部分可以按照@user20650 的建议使用 trellis.par.set() 增加,但它不包括图例的字体大小。

trellis.par.set(par.xlab.text = list(cex = 1.4),par.ylab.text = list(cex = 1.4))
plot(x,type = "trace",facet_items = FALSE,scales = list(cex = 1.4),par.strip.text = list(cex = 1.4),main = FALSE)

此外,这对以下情节没有影响:

plot(x,type = "infoSE",main = FALSE)

解决方法

您可以使用 trellis.par.set 全局设置参数,或使用 par.settings 参数传递到单个图。 trellis.par.get() 可用于获取可更新对象的名称列表。

例如,以下内容可用于更新绘图中的特定参数

plot(x,type = "trace",par.settings=list(
       par.xlab.text=list(cex=3,col="red"),par.main.text=list(cex=2)))

或者全局更新使用

trellis.par.set(par.xlab.text=list(cex=3,par.main.text=list(cex=2)
                )

使用 grid.pars=list(cex=3)) 似乎更新所有文字大小

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...