gpt4 book ai didi

r 语言 mtext 不适用于 image.plot 数组

转载 作者:行者123 更新时间:2023-12-03 20:25:56 25 4
gpt4 key购买 nike

我正在使用 R 使用 image.plot 绘制一组图。一切正常,只是我无法让 mtext() 显示主标题。使用 matplot() 对一组图使用非常相似的代码工作正常。

我正在使用的代码如下。

op <- par(mfrow = c(2, 2))
par(mar=c(5, 4, 4, 2) + 0.1)
par(oma = c(0,0,2,1))
for (i in 2:nout){
image.plot(r,th,t(u[i,,]),xlab="r",ylab=expression(paste(theta)),
zlim=c(0.1,0.9), main=paste("t = ",t[i]),col=pal)
}
mtext(side=3, outer=TRUE, cex=1.25, line=2,expression(
paste("u(t,r,",theta, ")")))

任何帮助表示赞赏。

最佳答案

我遇到了一些奇怪的问题 mtext() image.plot() 的问题以及。我发现的一种解决方法是使用 title() “重新启用”绘图设备,例如:
image.plot(x,y,z)

title("")

mtext("Title",side=3)

关于r 语言 mtext 不适用于 image.plot 数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12895783/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com