data <- data.frame(x = 1:1000, y = rnorm(1000))
ggplot2::ggplot(data = data, ggplot2::aes(x = x, y = y)) +
ggplot2::geom_point() +
xgx_annotate_status("DRAFT")
# for dates in x-axis
data <- data.frame(x = as.Date(c("2015-01-01", "2016-01-01")), y = c(1,2))
xmax <- max(na.omit(data$x))
ggplot2::ggplot(data, ggplot2::aes(x = x, y = y)) +
ggplot2::geom_point() +
xgx_annotate_status("DRAFT", x = xmax)
Run the code above in your browser using DataLab