r语言mtext不能与image.plot数组一起使用

Gra*_*m G 5 r

我正在使用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, ")")))
Run Code Online (Sandbox Code Playgroud)

任何帮助赞赏.

小智 11

我也遇到了一些奇怪的mtext()问题image.plot().我找到的一个工作是用来title()"重新参与"绘图设备,这样:

image.plot(x,y,z)
title("")
mtext("Title",side=3)


Jan*_*ary 0

您将顶部外边距设置为 2 行宽,并尝试在第三行打印文本,因为line参数 frommtext开始于0

line:在哪条 MARgin 线上,从 0 开始向外计数。