Re: [R] plotting 3 functions on same graph

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 03 Aug 2005 - 00:32:47 EST

Romain Francois <francoisromain@free.fr> writes:

> Le 02.08.2005 15:56, herodote@oreka.com a écrit :
>
> >hi all,
> >
> >I wish to draw on the same graphic device 3 functions.
> >
> >But i don't want them to be on different graph, i want to compare them on the same
> >
> >I don't need mfrow or mfcol, I need something else...
> >
> >1 graph on 1 device inside this graph 3 ploted function.
> >
> >I saw something unsing data.frame, but i think it's overkill, and something less complicated must exist, if not why?
> >
> >why not plot(func1,func2,func3) ??
> >
> >thks.
> >
> >
> Take a look at :
> ?points
> ?lines
> ?curve
> par(new=TRUE)

...and curve(...., add=TRUE). The minor gotcha is that you need to adjust the ylim setting to make sure that all curves fit.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Aug 03 00:36:53 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:01:09 EST