i wanna compare functions to be simple , let's say i want x^2 and x^5 in same plot ( it's not the case but if i get it i'll understand for others ) how i do it? x<-seq(-10, 10, l=100)> plot(x^2)and? tks [[alternative HTML version deleted]]
by the way, i want both in the same figure, not side by side or others.. tks [[alternative HTML version deleted]]
Hi Manoel, Try this: x<-seq(-10, 10, l=100) plot(x^2,type="l",col=2,ylim=range(x^2,x^5),ylab='f(x)') points(x^5,type="l",col=4) legend('topleft',c(expression(x^2),expression(x^5)),col=c(2,4),lty=1) See ?plot HTH, Jorge On Wed, Apr 23, 2008 at 11:23 PM, Manoel Santos <manoelsantos666@gmail.com> wrote:> i wanna compare functions > to be simple , let's say i want x^2 and x^5 in same plot ( it's not the > case but if i get it i'll understand for others ) > how i do it? > > x<-seq(-10, 10, l=100) > > plot(x^2) > and? > tks > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. >[[alternative HTML version deleted]]
On Thu, 24 Apr 2008, Manoel Santos wrote:> i wanna compare functions > to be simple , let's say i want x^2 and x^5 in same plot ( it's not the > case but if i get it i'll understand for others ) > how i do it?See ?curve example( curve ) HTH, Chuck> > x<-seq(-10, 10, l=100) >> plot(x^2) > and? > tks > > [[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. >Charles C. Berry (858) 534-2098 Dept of Family/Preventive Medicine E mailto:cberry at tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901