使用 ggplot2 进行数据可视化入门
Rick Scavetta
Founder, Scavetta Academy
ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width)) +
geom_point(color = "red")
| 类型 | 属性 |
|---|---|
| 颜色 | "red" |
在 geom_*() 中设置属性。
将颜色属性设置为"red"。

ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width)) +
geom_point(size = 10)
| 类型 | 属性 |
|---|---|
| 大小 | 4 |

ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width)) +
geom_point(shape = 4)
| 类型 | 属性 |
|---|---|
| 形状 | 4 |

使用 ggplot2 进行数据可视化入门