Re: [R] zoo plot: yearly marks on X-Axis

2009-09-13 Thread lanczos
Many thanks, the solution is simple and elegant, as usual ;). R is a great tool, the best I know, unfortunately I need more time to practice ... regards Tomas On Sat, 2009-09-12 at 22:52 -0400, Gabor Grothendieck wrote: > Try this: > > library(zoo) > x <- zoo(rnorm(1:6000), as.Date("1992-11-11"

Re: [R] zoo plot: yearly marks on X-Axis

2009-09-12 Thread Gabor Grothendieck
Try this: library(zoo) x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000)) plot(x, xaxt = "n") # cut time into years, remove duplicate years and convert back to Date yy <- as.Date(unique(cut(time(x), "year"))) axis(1, yy, format(yy, "%y")) There are a number of examples of custom X axes in t

Re: [R] zoo plot: yearly marks on X-Axis

2009-09-12 Thread lanczos
On Sun, 2009-07-26 at 13:17 +0200, Poersching wrote: > stvienna wiener schrieb: > > Hi all, > > > > I am plotting a financial time series, but I need a more detailed X-Axis. > > > > Example: > > x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000)) > > plot(x) > > > > The X-Axis is labeled "1995

Re: [R] zoo plot: yearly marks on X-Axis

2009-07-26 Thread Poersching
stvienna wiener schrieb: > Hi all, > > I am plotting a financial time series, but I need a more detailed X-Axis. > > Example: > x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000)) > plot(x) > > The X-Axis is labeled "1995", "2000" and "2005". > I would need either "1995", "1997", etc. or maybe

Re: [R] zoo plot: yearly marks on X-Axis

2009-07-25 Thread Gabor Grothendieck
There is an example of this in the examples section of ?plot.zoo after the comment: shade a portion of a plot and make axis fancier On Sat, Jul 25, 2009 at 8:36 PM, stvienna wiener wrote: > Hi all, > > I am plotting a financial time series, but I need a more detailed X-Axis. > > Example: > x <- zo

[R] zoo plot: yearly marks on X-Axis

2009-07-25 Thread stvienna wiener
Hi all, I am plotting a financial time series, but I need a more detailed X-Axis. Example: x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000)) plot(x) The X-Axis is labeled "1995", "2000" and "2005". I would need either "1995", "1997", etc. or maybe yearly I used google first, then look a