> Is is possible to plot points whose y coordinate correspond to that
> probability, instead of plotting the histogram bars? In other words,
> instead of having a bar of width 0.01 and height, say, 80, I'd like to
> have a single point at y = 0.8.

Very easily with ggplot2:

install.packages("ggplot2")
library(ggplot2)

qplot(carat, data=diamonds, stat="bin", geom="point")
qplot(carat, data=diamonds, stat="bin", geom="point", binwidth=0.01)
# or with a line
qplot(carat, data=diamonds, stat="bin", geom="line")

# oh and by default the y axis gives count, to give probalilites use
qplot(carat, ..density.., data=diamonds, stat="bin", geom="point")

Hadley
-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to