ecdf function from ggplot2