Alex van der Spek
2012-Nov-26 11:36 UTC
[R] zoo timeseries plot; minor tic mark level control
I cannot figure out how to tune the minor tic marks on the date axis of a zoo plot. I read hundreds of CSV files from a zip archive transparently. The time/date strings I convert to POSIXct format, order them and then make a zoo object as there may be cases which have unequal time stamping. As follows: ###################### #Transform timestamps and reorder them dat <- transform(dat, Timestamp = as.POSIXct(Timestamp, format = "%m/%d/%Y %H:%M:%S", tz ="Europe/Paris")) dat<-dat[order(dat$Timestamp),] #Make a zoo object zdt <- zoo(dat[,2:4], dat$Timestamp) #Plot plot.zoo(zdt,main=mttl,xlab=NULL,panel=panel.yaxis, yaxt='n',type = 'l',cex=0.2) ##################### The plot is easy. For this data the timestamping is every 5 seconds over many weeks (2 to 3 months). The standard tic mark labeling I get with the plot.zoo() is just the abbreviated name of the month (Oct and Nov). How can I add minor tic marks for the individual days? All and any help or pointers welcome. Alex van der Spek
Gabor Grothendieck
2012-Nov-26 12:05 UTC
[R] zoo timeseries plot; minor tic mark level control
On Mon, Nov 26, 2012 at 6:36 AM, Alex van der Spek <doorz at xs4all.nl> wrote:> I cannot figure out how to tune the minor tic marks on the date axis of a > zoo plot. > > I read hundreds of CSV files from a zip archive transparently. The > time/date strings I convert to POSIXct format, order them and then make a > zoo object as there may be cases which have unequal time stamping. As > follows: > ###################### > #Transform timestamps and reorder them > dat <- transform(dat, Timestamp = as.POSIXct(Timestamp, format = "%m/%d/%Y > %H:%M:%S", tz ="Europe/Paris")) > dat<-dat[order(dat$Timestamp),] > > #Make a zoo object > zdt <- zoo(dat[,2:4], dat$Timestamp) > > #Plot > plot.zoo(zdt,main=mttl,xlab=NULL,panel=panel.yaxis, > yaxt='n',type = 'l',cex=0.2) > ##################### > > The plot is easy. For this data the timestamping is every 5 seconds over > many weeks (2 to 3 months). The standard tic mark labeling I get with the > plot.zoo() is just the abbreviated name of the month (Oct and Nov). How > can I add minor tic marks for the individual days? > > All and any help or pointers welcome. > Alex van der Spek > > ______________________________________________ > R-help at 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.See the examples in ?plot.zoo . Several of those have major and minor tick marks. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Seemingly Similar Threads
- plot.ts versus plot.zoo
- [PATCH v2 5/7] nvc0: refactor TIC uploads to allow different specifics per generation
- [PATCH 23/23] nvc0: implement support for maxwell texture headers
- [PATCH 1/7] nv50: use SIFC for TIC, TSC upload
- [PATCH 4/5] nvc0: refactor TIC uploads to allow different specifies per generation