[R] graphing help: line runs off top of graph

David Winsemius dwinsemius at comcast.net
Thu Feb 4 14:32:04 CET 2010


On Feb 4, 2010, at 4:42 AM, Faheem Mitha wrote:

>
>
> On Wed, 3 Feb 2010, David Winsemius wrote:
>
>> args <- commandArgs()
>> filename = args[6]
>> m = read.csv(filename, header=TRUE)
>> m = data.frame(scale(m, center=FALSE, scale = c(60, 1024^2, 1024^2,  
>> 1)))
>> mRSS = m[,c("time", "RSS")]
>> mVSZ = m[,c("time", "VSZ")]
>> mPERCENT = m[,c("time", "X.MEM")]
>> pdf(file=paste(strsplit(filename, "\\.")[[1]][1],".pdf", sep=""))
>>> plot(mRSS, col="red", type='l', xlab="time (min)",
>> # add a more "inclusive" or "expansive" ylim argument
>>       ylim=max(c(mRSS,mVSZ)),
>>
>>> ylab="memory (GB)")
>>> lines(mVSZ, col="royalblue", type='l')
>>> #plot(mPERCENT)
>>> dev.off()
>
> Thanks David,
>
> ylim=c(0,max(mRSS[,2], mVSZ[,2]))
>
> works well. the ylim help says a ylim of length one works, but I was  
> getting an error. Also, not sure what max(c(mRSS,mVSZ)) gives  
> (collective max of all the values in both data frames?) , but it  
> isn't what I want.

I do see why one would want to use the method you chose. I'm glad you  
were abel to figure it out despite my error.

>
>                                                         Regards,  
> Faheem.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list