r : ecdf over histogram
in R, with ecdf I can plot a empirical cumulative distribution function plot(ecdf(mydata)) and with hist I can plot a histogram of my data hist(mydata) How I can plot the histogram and the ecdf in the same plot? EDIT I try make something like that https://mathematica.stackexchange.com/questions/18723/how-do-i-overlay-a-histogram-with-a-plot-of-cdf symbolrush Also a bit late, here's another solution that extends @Christoph 's Solution with a second y-Axis. par(mar = c(5,5,2,5)) set.seed(15) dt <- rnorm(500, 50, 10) h <- hist( dt, breaks = seq(0, 100, 1), xlim = c(0,100)) par(new = T) ec <- ecdf