且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

根据数据集中的另一个变量设置背景颜色

更新时间:2023-01-28 18:54:36

You didn't supply an image of how ideally this would look, so how about something like:

ggplot(data=SO) +
   geom_rect(aes(xmin=date,xmax=date+1,ymin=min(latitude),ymax=max(latitude), 
      fill=eqx.effect)) +
   geom_line(aes(x=date,y=latitude),color="yellow")