s-news
[Top] [All Lists]

continuous plot over barplot

To: <s-news@lists.biostat.wustl.edu>
Subject: continuous plot over barplot
From: "David Parkhurst" <parkhurs@ariel.ucs.indiana.edu>
Date: Tue, 26 Oct 2004 20:19:24 -0500
I'm lecturing on the normal approximation to the binomial, and want to overlay the two onto a single plot.  I tried this:
 
x <- 60:100
y <- dbinom(x,100,0.7)
xy <-d ata.frame(x,y)
plot(x,y)
yy <- dnorm(x,70,sqrt(21))
lines(x,yy)
but at the lines command, a second (but blank) graphics window opens.  How can I overlay the normal plot on the barplot of the binomial?
 
Thanks.
 
Dave Parkhurst
<Prev in Thread] Current Thread [Next in Thread>