You might also use ?curve # same example as Bill's par(mar = c(5,4,2,4)+0.1, yaxs = "r") Sample <- rgamma(1000,2.5,.8) hist(Sample, main = "", freq = FALSE, ylim = c(0,1))
curve(pgamma(x, 2.5, 0.8), add=T, col='red') curve(dgamma(x, 2.5, 0.8), add=T, col='darkgreen') axis(4, col = "red") mtext(side = 4, text = "Cumulative probability", col = "red", line = 2.5) x0 <- c(0, sort(Sample)) p0 <- 0:1000/1000 lines(x0, p0, type = "S", col = "blue") Regards, Matthieu ______________________________________________ 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.