Skip to content
Prev 103234 / 398500 Next

Put a normal curve on plot

Here is some sample code that shows 2 different approaches, which you
want to use depends on what exactly you want to do and which will be
easier for you, the one draws the normal around the 6,7 point, the other
around the 3,4 point, change those values to do your plot:

plot(1:10, 2:11)

xx <- seq(-3,3,.1)

lines( 6+dnorm(xx,0,.75), 7+xx )

library(TeachingDemos)
subplot( plot(dnorm(xx),xx, type='l', axes=F,xlab='',ylab=''), 3,4,
hadj=0 )

Hope this helps,