[R] 2 plots 1 figure

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Nov 15 17:51:14 CET 2000

j.logsdon at lancaster.ac.uk writes:

> (perhaps better for general discussion)
> par(new=TRUE) 
> Just a casual aside - why has the standard been new=TRUE for overplotting
> on old graph?  This has always seemed perverse and counter-intuitive to me
> but perhaps there is an explanation - other than for compatability with S+
> of course.  Anyone know?
> John

The logic is as follows: When something is plotted to a frame, the
paper is dirtied, so to speak, by saying "this is not a new frame",
which is reflected in par(new) == FALSE. Conversely, when advancing to
a new frame, we use plot.new() which sets par(new) == TRUE. High level
plots query par(new) to see whether it is necessary to advance to a
new frame. So explicitly setting par(new)<-TRUE means "pretend this is
a new frame, even though someone already scribbled on it".

I get it wrong half the time too, though... We have frame() as a
more intuitive version of plot.new(), maybe one could think of an
alias for par(new=TRUE) too? overplot() perhaps? 

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list