dput(df)
structure(list(Month = structure(c(15248, 15522), class = "Date"),
Value = c(1, 3)), .Names = c("Month", "Value"), row.names = 1:2, class = "data.frame")
ggplot(df, aes(Month, Value)) +
geom_bar(fill = "orange", size = .3, stat = "identity", position = "identity") +
geom_smooth(data = df, aes(Month, Value, group = 1), method = "lm",
size = 2, color = "red") +
scale_x_date(breaks = "1 month", labels = date_format("%b-%Y"),
limits = as.Date(c('2011-01-01','2013-01-01')))
ggplot 中的条形图也超过了其他日期。我确实收到此警告消息:
Warning message:
In qt((1 - level)/2, df) : NaNs produced
有没有办法将垃圾箱放置到所属日期,而不是交叉到其他日期?