set1$duration<- as.POSIXct(paste('2013-08-24', set1$duration)) plot(set1$duration,as.numeric(levels(set1$duration.1)[set1$duration.1]),type="b",col = "blue", ylim=c(0,max(as.numeric(levels(set1$duration.1)[set1$duration.1]))),ylab="Duration", xaxt = 'n', xlab="Time",las=2,lwd=2.5, lty=1,cex.axis=1.2)
axis(1, at = set1$duration, labels = set1$duration, las = 2,cex.axis=1.2) text(set1$duration,as.numeric(levels(set1$duration.1)[set1$duration.1]), as.numeric(levels(set1$duration.1)[set1$duration.1]), 2, cex=1.45) I have used 'syntax' to use 'factors'. Works perfectly but I still don't know what factors are. Have been using them everywhere without understanding :-) Thanks, Mohan From: jim holtman <jholt...@gmail.com> To: mohan.radhakrish...@polarisft.com Date: 09/05/2013 10:05 PM Subject: Re: [R] Y-axis labels as decimal numbers your x-axis appears to be incorrect because your 'duration' field flips over midnight. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Sep 5, 2013 at 9:22 AM, <mohan.radhakrish...@polarisft.com> wrote: > Hi, > I am able to create a graph with this code but the decimal > numbers are not plotted accurately because the ylim values are not set > properly. x-axis is proper. > > How do I accurately set the ylim for duration.1 column ? > > Thanks, > Mohan > > set1$duration<- as.POSIXct(paste('2013-08-24', set1$duration)) > plot(set1$duration,set1$duration.1,type="b",col = "blue", ylab="", xaxt = > 'n', xlab="",las=2,lwd=2.5, lty=1,cex.axis=2.5) > # now plot you times > axis(1, at = set1$duration, labels = set1$duration, las = 2,cex.axis=2.5) > > duration duration.1 > 2 16:03:41 0.05 > 3 17:03:41 0.27 > 4 18:03:43 1.22 > 5 19:03:45 1.51 > 6 20:03:47 1.27 > 7 21:03:48 1.15 > 8 22:03:50 1.22 > 9 23:03:52 1.27 > 10 00:03:54 1.27 > 11 01:03:55 1.22 > 12 02:03:57 1.26 > 13 03:03:59 1.57 > 14 04:04:01 1.31 > 15 05:04:03 1.24 > > > 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. 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.