Hello Rui Barradas thank you very much. That is exactly what I was looking for.
Christof Am 20-10-2012 14:19, schrieb Rui Barradas: > library(zoo) > > arrowsRange <- function(from, to, at = 1, labels = NULL, > length = 1/8, horizontal = TRUE, border = FALSE, ...){ > require(plotrix) > f1 <- function(){ > if(horizontal) > arrows(from, at, to, at, length = length, code = 3, ...) > else > arrows(at, from, at, to, length = length, code = 3, ...) > } > f2 <- function(){ > f1() > if(horizontal){ > x <- rowMeans(cbind(from, to)) > y <- at > }else{ > x <- at > y <- rowMeans(cbind(from, to)) > } > boxed.labels(x, y, labels = labels, border = border) > } > if(is.null(text)) f1() else f2() > } > > > # Make up some test data > set.seed(9365) > z <- zoo(cumsum(rnorm(365))) > index(z) <- Sys.Date() + 1:365 > start <- as.Date(c("2012-12-21", "2013-03-21", "2013-06-22")) > end <- as.Date(c("2013-03-20", "2013-06-21", "2013-09-21")) > seasons <- c("Winter", "Spring", "Summer") > plot(z) abline(v = c(start[1], end)) arrowsRange(start, end, at = 0, labels = seasons) ______________________________________________ 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.