[Rd] Title obscured when using par(mfrow) (PR#3463)

brahm at alum.mit.edu brahm at alum.mit.edu
Fri Jul 11 21:30:16 MEST 2003

I want to put multiple plots on a page using par(mfrow), then a single title at
the top.  This should work, but doesn't:

 R> par(oma=c(0,0,4,0), mfrow=c(3,4))
 R> for (i in 1:12) {plot(1); title(i)}
 R> ## text(10,10, ".")
 R> par(mfrow=c(1,1), oma=c(0,0,1,0))
 R> title("Main Title")

The main title does not appear.  However, uncommenting the third line (making
an otherwise superfluous call to "text") fixes the problem.

This seems to be true regardless of whether my device is x11, postscript, or
pdf.  The diff of the Postscript files (without and with the "text" command)
may be illuminating to some experts:

  mica> diff bug.ps nobug.ps 
  > 623.97 66.47 754.04 158.36 cl
  > 18.00 18.00 774.00 579.60 cl
  > 0 0 0 rgb

Finally, here's an interesting variation, in which only the left side of the
title is obscured:

 R> par(mfrow=c(1,2))
 R> for (i in 1:2) plot(1)
 R> ## text(10,10, ".")
 R> par(mfrow=c(1,1))
 R> title("Main Title")

Again, uncommenting the third line allows the full title to appear.

 platform = sparc-sun-solaris2.8
 arch = sparc
 os = solaris2.8
 system = sparc, solaris2.8
 status = 
 major = 1
 minor = 7.1
 year = 2003
 month = 06
 day = 16
 language = R

Search Path:
 .GlobalEnv, package:misc, package:io, package:arrays, package:ls1, package:obsi, package:g.data, package:db, package:ts, package:ctest, Autoloads, package:base
                              -- David Brahm (brahm at alum.mit.edu)

More information about the R-devel mailing list