[R] title for plot contain 4 subplots

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Sep 14 20:50:00 CEST 2003


On 14 Sep 2003, Rajarshi Guha wrote:

> On Sun, 2003-09-14 at 13:18, Rajarshi Guha wrote:
> > 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:
> 
> Thanks for the solution to the above problem. I am facing another
> problem which seems to stem from the one above. After getting my plot on
> screen I do 
> dev.copy(png, file="out.png") 
> dev.off()
> 
> The resultant PNG file shows the plots ok, but the ends of the overall
> title get cut off. I tried changing the values in the oma vector tp par,
> but it does'nt change anything.
> 
> Has anybody faced this?

Yes. It's even mentioned in several places, including on the dev.copy help
page (under some of the wrappers).  dev.copy assumes proportionate
pointsizes on the two devices, and that is unlikely to be true.  Either
replot on the png device or adjust pointsize on the target in your
dev.copy call.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list