我正在尝试绘制标题、希腊字符以及变量的平均值。我希望我的情节标题看起来像这样(但居中)
Title
μ=1.2
我做了一些尝试:
d <- rnorm(100)
hist(d, main=expression(paste("Title\n", mu, "=", mean(d))))
hist(d, main=expression(paste("Title\n", mu, "=", mymean), list(mymean=mean(d))))
hist(d, main=paste(expression(paste("Title\n", mu, "="), mean(d))))
hist(d, main=expression(atop("Title", substitute(mu, "=", mymean, list(mymean=mean(d))))))
hist(d, main=expression("Title\n", substitute(mu, "=", mymean, list(mymean=mean(d)))))
但我不知道如何使用expression
or substitute
标题中正确。我知道mtext
这是一种可能性,但它应该使用 main= 参数来工作......?