[R] Grid-drawing in plot.its OR how to influence axTicks

From: Schneider, Manuel <Manuel.Schneider_at_eawag.ch>
Date: Wed, 23 May 2007 09:53:56 +0200

Dear List,

I am ploting an its object with user-specified ticks on the x axis, but cannot figure out how to adjust the plotted grid to these ticks.

> temp <- its(1:3,dates=as.POSIXct(strptime(c("1999-12-31
01:00:00","2000-01-01 02:00:00","2000-01-10 02:00:00"),format="%Y-%m-%d %X")))
> plot(temp)

Gives the grid alined with the ticks on the y-axis but not on the x-axis

> d<-as.POSIXct(round(range(dates(temp)),"days"))
> atTicks<-seq(d[1], d[2], by="day")
> plot(temp, at=atTicks)

Gives daily ticks but does not affect the grid

> axTicks(1)

[1] 946600000 946800000 947000000 947200000 947400000
> unclass(atTicks)

 [1] 946594800 946681200 946767600 946854000 946940400 947026800 947113200
 [8] 947199600 947286000 947372400 947458800 attr(,"tzone")
[1] ""
axTicks(1) gives where grid is drawn, unclass(atTicks) gives where the Ticks are (and where I would like the grid is drawn).

> plot(temp, at=atTicks,

xaxp=c(unclass(range(atTicks)),length(atTicks)-1)) Does not help and my question simply is how to make axTicks(1) to be unclass(atTicks).

Many thanks for any hints.


R-help_at_stat.math.ethz.ch 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. Received on Wed 23 May 2007 - 08:55:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 09:31:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.