I am trying to plot the CDF using ggplot2 in R and I get the following plot
But the min and max values of the data are 1947 and 2017. I do not want the line to be plot beyond the ranges [1947, 2017].
ggplot(df, aes(x=year)) + stat_ecdf(geom="line") + xlab("Year") + xlim(1947, 2017)
Can anyone help with this issue?