[R] many curves to the same plot

R. Michael Weylandt michael.weylandt at gmail.com
Mon Mar 26 16:48:18 CEST 2012


You can use lines() with ecdf objects or use the
not-at-all-surprisingly-named add = TRUE parameter of curve().

Michael

On Mon, Mar 26, 2012 at 10:44 AM, Alaios <alaios at yahoo.com> wrote:
> Dear all,
> I would like to plot under the same plot
> many curves like
>
> mycdf<-ecdf(runif(100))
> plot(mycdf)
> curve(mycdf,from=-1,to=1)
>
>
> mycdf<-ecdf(runif(200)+3)
> plot(mycdf)
> curve(mycdf,from=-1,to=1)
>
> as you can see each new call to curve redraws (erases) the window. How I can have an effect like
> plot(mycdf)
> lines(mycdf2)
> lines(mycdf3)
>
> I would like to thank you in advance for your help
>
> Regards
> Alex
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list