Plot separate years on a common day-month scale

后端 未结 3 1884
迷失自我
迷失自我 2020-12-20 08:26

I want to create a time series plot of temperatures for the summers of 2012 and 2013.

The only problem is that I want the data series to plot one on top of the oth

3条回答
  •  长情又很酷
    2020-12-20 08:42

    If you want to plot both years in the same plot above each other then use dayMo as your x values (they don't have to be date object).

    df$dayMo<-c("06-01", "07-01","08-01","09-01","06-01", "07-01","08-01","09-01")
    ggplot(df, aes(dayMo, temp, color=year))+
      geom_point()
    

提交回复
热议问题