Getting range is too small for min.n error

前端 未结 1 681
夕颜
夕颜 2021-01-20 06:23

I am trying to make a line graph of some performance data that I have collected using R. I want to graph each cpu and the total. I have a Names column in my txt file and I

相关标签:
1条回答
  • 2021-01-20 06:30

    The error message is due to fact that your x values are datetime and difference between two values is just one second (too small to show data). You have to use scale_x_datetime() and set breaks to "1 sec" to show your data.

    library(ggplot2)
    library(scales)
    ggplot(cpu, aes(Date, Usage, colour=Name)) + 
       geom_line(size=1) + 
       scale_x_datetime(breaks = date_breaks("1 sec"))
    

    enter image description here

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