Save a ggplot2 time series plot grob generated by ggplotGrob
问题 This post describes a method to create a two-line x-axis (year below months) on a time series plot. Unfortunately, the method that I use from this post ( option 2 ) is not compatible with ggsave() . library(tidyverse) library(lubridate) df <- tibble( date = as.Date(41000:42000, origin = "1899-12-30"), value = c(rnorm(500, 5), rnorm(501, 10)) ) p <- ggplot(df, aes(date, value)) + geom_line() + geom_vline( xintercept = as.numeric(df$date[yday(df$date) == 1]), color = "grey60" ) + scale_x_date