Adding an extra point in a ggplot2 graph

前端 未结 3 1684
粉色の甜心
粉色の甜心 2021-02-20 15:19

I have created a plot of the Sepal.Length and the Sepal.Width (using the iris dataset) with ggplot2.

  ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, col =          


        
3条回答
  •  攒了一身酷
    2021-02-20 16:06

    library('ggplot2')
    
    df = data.frame(Sepal.Width = 5.6, Sepal.Length = 3.9) 
    
    ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, col = Species)) +
      geom_point() +
      geom_point(data = df, col = 'blue')
    

提交回复
热议问题