Constructing a line graph using ggplot2

后端 未结 2 796
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 07:47

I need to plot three lines (onto a single graph) each of which represents one lab team\'s data (two variables / team). Ideally, the graph should look aesthetically pleasing (hen

2条回答
  •  野性不改
    2021-01-21 08:27

    I'd do something like:

    library(ggplot2)
    ggplot(mtcars, aes(x = wt, y = mpg, color = as.factor(cyl))) + geom_line()
    

    enter image description here

    If you want more specific advice, I would suggest you expand your example, and include some example data, and provide more details regarding what the visualisation should tell.

提交回复
热议问题