Hi there,
Perhaps:
set.seed(122)
x=1:50
y1=2*x+x^2
y2=x^2
plot(x,y1,ylim=range(y1,y2),type='l',ylab=expression(f(x)),xlab='x',
main='Two superimposed graphs')
points(x,y2,type='l',col=2)
legend(topleft,c(expression(f(x)==2*x+x^2),expression(f(x)==x^2)),lty=1,col=1:2)
Also you could check ?curve
Hio
i tried to do this by:
par(new=TRUE)
but the result is one picture but y-axis has 2 différent graduations.how can
i correct this?( i want one graduation on y axis).
--
View this message in context:
http://www.nabble.com/how-can-i-superpose-2--graphs-tp17305355p17305355.html
Sent from the
hanen hanen.mastouri at yahoo.fr writes:
i tried to do this by:
par(new=TRUE)
but the result is one picture but y-axis has 2 différent graduations.how can
i correct this?( i want one graduation on y axis).
?lines
?points
Dieter
__
3 matches
Mail list logo