I am using R to plot an array of plots using image.plot. Everything works well except that I cannot get mtext() to display a main title. Using very similar code for an array of plots using matplot() works fine.
The code I am using is given below.
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, ")")))
Any help appreciated.
I've run into some weird mtext()
issues with image.plot()
as well. One work around I've found is to use title()
to "re-engage" the plot device, such that:
image.plot(x,y,z)
title("")
mtext("Title",side=3)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With