[R] title for plot contain 4 subplots

Rajarshi Guha rajarshi at presidency.com
Sun Sep 14 19:13:49 CEST 2003


Hi,
  I'm plotting 4 graphs on one page (2x2 matrix) but I cant seem to get
the title for the whole page right.

I'm doing:

op <- par(mfrow = c(2,2), pty="s")
hist(var$V2, breaks="FD",main="Euclidean Metric", xlab="Sum of 3NN ...
hist(var$V2, breaks="FD",main="Manhattan Metric", xlab="Sum of 3NN ...
hist(var$V2, breaks="FD",main="Euclidean Metric", xlab="Sum of 3NN ...
hist(var$V2, breaks="FD",main="Manhattan Metric", xlab="Sum of 3NN ...

At this point I would like to place a title at the head of the page
(like in the P-P plot example on the Chisquare help page. I'm doing:

mtext("Sum of 3NN Distances (per molecule) for Varying Distance
Metrics")

but it places this title as the title of the last plot and not the whole
page. The mtext help page says that I can use it to write text to the
outer margins of the device region but I cant seem to work out how I can
acheive this.

Thanks
-------------------------------------------------------------------
Rajarshi Guha <rajarshi at presidency.com> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
Q: What do you get when you put a spinning flywheel in a casket and
turn a corner?
A: A funeral precession.




More information about the R-help mailing list