散點圖

我們使用內建虹膜資料集繪製一個簡單的散點圖,如下所示:

library(ggplot2)
ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Species)) + 
  geom_point()

這給出了: StackOverflow 文件