Re: [R] Superimpose xversus y plot on a histogram of x

2011-11-01 Thread R. Michael Weylandt
Plot doesn't create an object to be plotted later like in ggplot: rather it, by default, makes a new plot and erases the histogram. > hist(z) > lines(z, y, lwd = 1) should work, though you may need to add freq=FALSE to hist() MW On Nov 1, 2011, at 6:42 PM, Jim Silverton wrote: > I need a pl

Re: [R] Superimpose xversus y plot on a histogram of x

2011-11-01 Thread Jim Silverton
I need a plot with a histogram z and a plot of z versus y superimposed. This is not working... z = rnorm(1000) y = rnorm(1000,1,2) hist(z) dx = plot(z, y, lwd = 1) lines(dx, add=TRUE) -- Thanks, Jim. [[alternative HTML version deleted]] __ R