点图
点图 (Dot plot),每个点指代一个观察对象。
载入R包。
library(ggplot2)
画出一个基本的点图。
ggplot(data = iris, aes(x = Sepal.Length)) +
geom_dotplot()
简单修饰点图。
ggplot(data = iris, aes(x = Sepal.Length)) +
geom_dotplot(fill = "transparent", colour = "lightsalmon3", binwidth = 0.18, stroke = 2) +
theme_classic() +
labs(x = "",
y ="")
2023-02-14 16:53