Hi Jim, I am using this code and it is working well. I convert everything to MB. I may not fully understand "levels(data$Used)[data$Used])" but I use it everywhere and it works.
data$Used <- as.numeric(levels(data$Used)[data$Used])/(1024*1000) data$Committed <- as.numeric(levels(data$Committed)[data$Committed])/(1024*1000) data$Max<- as.numeric(levels(data$Max)[data$Max])/(1024*1000) print(data) png( "code-cache.png", width =1200, height = 500) plot(data$Time,as.numeric(data$Used),ylim=c(1,60),col="orangered",pch=2,type="b", ylab="Megabytes", xlab="",las=2,lwd=2,xaxt="n", cex.lab=1.2,cex.axis=1.2) axis(1,at = seq(min(data$Time), max(data$Time), by=1000),las = 2,cex.axis=1) title("Time vs Used Code cache,Committed and Maximum Code cache",cex.main=1.5,xlab="Time(Every 200 Seconds)") points(data$Time,as.numeric(data$Committed),col="grey",pch=3,lwd=2, cex.lab=1.2,cex.axis=1,type="b") points(data$Time,as.numeric(data$Max),col="palevioletred3",pch=16,lwd=2, cex.lab=1.2,cex.axis=1,type="b") dev.off() Thanks, Mohan From: Jim Lemon <j...@bitwrit.com.au> To: mohan.radhakrish...@polarisft.com Date: 11/05/2013 03:47 AM Subject: Re: [R] All curves with same y-axis scale On 11/04/2013 11:04 PM, mohan.radhakrish...@polarisft.com wrote: > Hi, > > I changed the code. The first two curves seem to plot properly without > the 'ylim'. 'ylim' doesn't allow the first two curves to plot properly. > It doesn't have any effect on the 3rd curve. > > plot(data$Time,as.numeric(data$Used),ylim=c(min(as.numeric(data$Used)),max(data$Max)),col="green",pch=16,type="b", > ylab="MegaBytes", xlab="",las=2,lwd=2,xaxt="n", cex.lab=1.2,cex.axis=1.2) > axis(1,at = seq(min(data$Time), max(data$Time), by=1000),las = > 2,cex.axis=1) > Hi Mohan, Looks like it's doing what you ask of it to me. data<-read.table(text="Init Used Committed Max Time 2359296 13913536 13959168 50331648 200 2359296 13915200 13959168 50331648 400 2359296 13947712 13991936 50331648 600 2359296 13956224 13991936 50331648 800 2359296 13968832 14024704 50331648 1000 2359296 13978048 14024704 50331648 1200 2359296 14012416 14090240 50331648 1400 2359296 14450304 14548992 50331648 1600 2359296 14521024 14548992 50331648 1800 2359296 14536320 14548992 50331648 2000 2359296 14553344 14581760 50331648 2200",header=TRUE) png("mk.png") plot(data$Time,as.numeric(data$Used) ,ylim=c(min(as.numeric(data$Used)),max(data$Max)), col="green",pch=16,type="b", ylab="MegaBytes", xlab="",las=2,lwd=2,xaxt="n", cex.lab=1.2,cex.axis=1.2) axis(1,at = seq(min(data$Time), max(data$Time), by=1000),las = 2,cex.axis=1) title( "Time vs Used Code cache,Committed and Maximum Code cache", cex.main=1.5,xlab="Time(Every 200 Seconds)") points(data$Time,as.numeric(data$Committed), col="orangered",pch=16,lwd=2, cex.lab=1.2,cex.axis=1,type="b") points(data$Time,as.numeric(data$Max), col="palevioletred3",pch=16,lwd=2, cex.lab=1.2,cex.axis=1,type="b") dev.off() Jim [attachment "mk.png" deleted by Mohan Radhakrishnan/BSC31/polarisFT] This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit us at http://www.polarisFT.com [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.