[R] plotting and overlay

kjetil@entelnet.bo kjetil at entelnet.bo
Sat Nov 22 23:25:26 CET 2003


On 22 Nov 2003 at 13:37, christoff pale wrote:

In R many graphics functions take an argument add, and there are some
functions (points, lines) which add data to an existing graph. 

Some examples:

plot( dnorm, from=-3, to=3 )
plot( function(x) dt(x, 2), from=-3, to=3, col="red2", add=TRUE)

x <- rnorm(20)
y <- rnorm(20)
plot(x,t, type="n")
points(x,y, col="skyblue")

Kjetil Halvorsen

> Hi,
> I am use to matlab and when I want to 
> overlay multiple plots on the same graphics devise
> I type in "hold on" and when I am done I type in
> "hold off"
> 
> Does R have an equivalent feature?
> can someone give me an example where they plotted
> 2 functions on top of each other? thanks
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list