Search code examples
rplotcdfweibullecdf

How can I plot two cumulative distributions curve as line type in same plot


I want to plot cumulative distributions curve for Weibull distribution over empirical cumulative distribution curve.

I have tried with this several times but it does not serve the way I want. Here is the command:

x<-(SIZEDIST$AVG.µm.)
x
plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4)
plot(ecdf(x),add=TRUE)

Solution

  • Use lines instead of plot

    plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4)
    lines(ecdf(x),col='red')