[R] Scale of axis for two data sets

Jim Lemon jim at bitwrit.com.au
Tue Aug 27 14:36:12 CEST 2013


On 08/27/2013 10:08 PM, Jim Lemon wrote:
> On 08/27/2013 10:01 PM, mohan.radhakrishnan at polarisft.com wrote:
>> Hi,
>> Can't one y-axis be used ? Both 'Kbytes' and 'RSS' use the
>> same unit.
>>
>>
> Hi Mohan,
> Yes, you can use a single y axis. What you probably want is something
> like this:
>
> ylim<-range(c(Kbytes,RSS))
> plot(rNo,Kbytes,col=2,pch=1,type="b")
> points(rNo,RSS,col=3,pch=2,type="b")
>
Bleagh! Too late. should be:

plot(rNo,Kbytes,col=2,pch=1,type="b",ylim=ylim)
points(rNo,RSS,col=3,pch=2,type="b")

Jim



More information about the R-help mailing list