以下是代码:
df <- data.frame(day <- 0:365, value = 1)
library(ggplot2)
ggplot(df, aes(day, value)) + geom_blank() + scale_x_continuous(breaks = seq(0, 365, 10)) + theme_bw()
生成这个图:
使用R代码,我想根据day
属于哪个月份来对图的背景进行着色。 我希望绘图看起来像下面这样(图片的背景经过Photoshop处理)。 我特别希望使用lubridate
解决此问题。