For example, I would like to produce a plot like the enclosed for a
binomial distribution with size=20 and prob=0.5. Should I use
geom_rect or is there a better way?
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
<foo.png>
Thank you. I was missing the factor(x) part and couldn't get
geom="bar" to be happy
How aboutx <- 0:20qplot(factor(x), dbinom(x, 20, .5), geom = 'bar')
myData <- data.frame( k = factor(0:20), pK = dbinom(x, 20, .5))
ggplot(myData,aes(k,ymin=0,ymax=pK)) + geom_linerange() + ylab("p(k)") + scale_x_discrete(breaks=seq(0,20,5))