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 yearly
>
>
> I used google first, then look at "?plot.zoo" but could't get it working.
>
>
> Regards,
> Steve
>
> ______________________________________________
> 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.
>
>   
Hey,

try something like the following:

plot(x, y, xaxt="n")
axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "years"),
labels = FALSE, tcl = -0.2)
axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "5 years"),
labels = TRUE, las=3, tcl = -0.2)

Regards,
Christian

        [[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.

Reply via email to