[R] plotting and overlay

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Nov 23 07:22:39 CET 2003

On Sat, 22 Nov 2003, Duncan Murdoch wrote:

> On Sat, 22 Nov 2003 13:54:34 -0800, Spencer Graves
> <spencer.graves at pdf.com> wrote:
> >Start the plot using "plot", add lines and points using "lines" and 
> >"points", as described in the examples with "?plot". 
> That's how you do plots that you construct yourself; you can get a lot
> of the higher level functions (e.g. hist) to do this using the
> argument "add=TRUE".

And if you really want to overlay plots, there is par(new=TRUE).  (This 
will replot the axes etc, so the second plot may perhaps need axes=FALSE 
or xaxt="n", yaxt="n" in its 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