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

David Winsemius dwinsemius at comcast.net
Wed Feb 3 19:08:59 CET 2010


On Feb 3, 2010, at 12:53 PM, Faheem Mitha wrote:

>
> Hi,
>
> See the files at
>
> http://bulldog.duhs.duke.edu/~faheem/R/
>
> Usage is
>
> $ Rscript memgraph.R meminfo.csv
>
> Output is meminfo.pdf. As you can see, one of the lines (blue) runs  
> off the top of the graph. Can anyone suggest a way to avoid this  
> happening?
>
> Please CC me on any reply. Thanks in advance.
>
>                                                        Regards,  
> Faheem.
>
> ************************************************************************
> memgraph.R
> ************************************************************************
> 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()

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list