Skip to content
Prev 316673 / 398502 Next

Range difference of plot two arrays in one plot

Hello David,

When I used the same ylim for both plots, I got what I need:

x = c(0,0,0,10,20,30)
y = c(40,50,60,70,80,90)
plot(x, type='o', ylim=c(min(x,y),max(x,y)))
par(new=T)
plot(y, type='l', ylim=c(min(x,y),max(x,y)))

Thanks,

Rebecca

-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: Friday, February 01, 2013 11:39 AM
To: Yuan, Rebecca
Subject: Re: [R] Range difference of plot two arrays in one plot
On Feb 1, 2013, at 10:28 AM, Yuan, Rebecca wrote:

            
Use the same ylim for each plot?
Message-ID: <419EED2318C2164DB95FBB20AA8810D80443AF@smtp_mail.bankofamerica.com>
In-Reply-To: <256A0EAA-7C62-40A5-9144-61FB0565B094@comcast.net>