Combine Points with lines with ggplot2

前端 未结 3 998
一生所求
一生所求 2020-12-05 07:03

I would like to plot a time series that look like this:

\"enter

what I plot wi

3条回答
  •  遥遥无期
    2020-12-05 07:17

    A small change to Paul's code so that it doesn't return the error mentioned above.

    dat = melt(subset(iris, select = c("Sepal.Length","Sepal.Width", "Species")),
               id.vars = "Species")
    dat$x <- c(1:150, 1:150)
    ggplot(aes(x = x, y = value, color = variable), data = dat) +  
      geom_point() + geom_line()
    

提交回复
热议问题