R: ggplot display all dates on x axis

后端 未结 1 1837
走了就别回头了
走了就别回头了 2020-12-09 10:04

I have the following data set

structure(list(Date = structure(c(16636, 16667, 16698, 16728, 
16759, 16789, 16820, 16851, 16880, 16911, 16636, 16667, 16698, 
         


        
相关标签:
1条回答
  • 2020-12-09 10:36

    The easiest way would be to use scale_x_date

    ggplot(data = df) + 
      geom_point(mapping = aes(x = Date, y = WearRate, color = Wheel))+
      scale_x_date(date_labels="%b %y",date_breaks  ="1 month")
    

    %b: Abbreviated month name
    %y: Year without century
    For a description of the full possibilities see ?strftime()

    0 讨论(0)
提交回复
热议问题