[R] overlaying plots

Andrew C. Ward andreww at cheque.uq.edu.au
Tue Oct 22 13:34:16 CEST 2002


Vlad,

This is typically achieved by drawing your 'main' plot first, then adding 
points, lines, etc to it for whatever else you want to plot. For instance
	> x <- rnorm(1000)
	> tmp <- hist(x)
	> points(tmp$mids, tmp$counts)
	> abline(v=mean(x), col="red", lwd=2, lty=3)


Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww at cheque.uq.edu.au



On Tuesday, October 22, 2002 9:40 AM, Vladimir Morozov 
[SMTP:VBMorozov at lbl.gov] wrote:
> Dear R-gurus:
>
> How do I overlay 2 plots in the same frame in R?
> Or, if I have a histogram, and I want to plot a function in the same 
frame -
> how do I do it?
>
> Thank you very much,
> Vlad
>
>
> 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.  
-.-.-.-
> 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
> 
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.  
_._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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