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

Faheem Mitha faheem at email.unc.edu
Thu Feb 4 10:42:48 CET 2010



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.

                                                          Regards, Faheem.



More information about the R-help mailing list