[R] help with the use of mtext to create main title over multiple plots

Dieter Menne dieter.menne at menne-biomed.de
Mon Oct 12 19:44:11 CEST 2009




Mark Kimpel wrote:
> 
> I'm trying to use mtext to create a main title over multiple plots. Below
> is
> a simple self-contained example and my sessionInfo (I should note I've
> also
> tried this with R-2.8.1 with the same results). When I execute the code
> 
> ...
> 
> 
> 

Thanks for your nice example showing the problem clearly. I normally prefer
to test these things in a window first, it's faster, though.

You had forgotten to give the poor graphics a bit of outer margin. If you
look carefully, you could have seen a few tail in the plot. The example
overreacts a bit, but you get the idea.
You might also reduce your plot margins a bit (see par) to avoid to large
empty space.

Dieter

par(mfrow=c(2,2),oma=c(10,10,10,10)
for (i in 1:4){
  plot(1:6, 1:6)
}
mtext(text = "my test plots", side = 1, outer = TRUE)

-- 
View this message in context: http://www.nabble.com/help-with-the-use-of-mtext-to-create-main-title-over-multiple-plots-tp25859951p25860178.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list