[R] 3 functions on same plot

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 9 08:47:03 CEST 2003

On Fri, 9 May 2003, Dowkiw, Arnaud wrote:

> I'd give the same xlim=c(-a,b) and ylim=(-c,d) parameters to these three
> functions and then, after each function call 
> >par(new=T)

Use par(xaxs="d", yaxs="d") is a better way to `lock' the scales (and you 
should omit the axes and annotations on subsequent plots).

> But maybe someone has got a better solution.


However, my understanding is that those three functions are unlikely to 
share a common scale (likelihood being different from the other two) so
either two scales will be needed or the likelihood would need to rescaled.

> From: Joachim Brouwers [mailto:joachim.brouwers at gmx.net]
> How can i plot 3 functions (prior, likelihood and posterior) on the same
> plot?

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