Dear List, I am trying to plot date vs. time, but am having problems getting my y-axis labels how I want them. When left on its own R plots time at 6 hour intervals from 03:00 to 23:00. I am wanting 6 hour intervals from 2:00 to 22:00. I realize yaxp doesn't work in plot(), so I am trying to get it to work in par(). However, now I get the ticks where I want them but the time is output as a very big number (serial time?). I have also tried axis() using at= and also get seriel time numbers. Any suggestions on how to format time on an axis?
mydat$Date<-as.POSIXct(as.character(mydat$Date), format=c("%m/%d/%Y")) mydat$Time<-as.POSIXct(as.character(mydat$Time), format=c("%H:%M:%S")) plot(mydat$DateTime,mydat$Time, xlab=c("Date"), ylab=c("Time"), xlim=c(min(mydat$DateTime),max(mydat$DateTime)), ylim=c(min(mydat$Time),max(mydat$Time)), yaxt="n", yaxs="i", pch=19, cex=.4, type="n") par(yaxp=c(as.POSIXct(as.character("02:00"), format=c("%H:%M")),as.POSIXct(as.character("22:00"), format=c("%H:%M")),5)) axis(2) Thanks, Tim Tim Clark Marine Ecologist National Park of American Samoa ______________________________________________ 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.