点图

点图 (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 ="")


▌欢迎关注公众号:R语言和统计
▌课程相关咨询可添加R师妹微信: kefu_rstats
▌邮箱:contact@rstats.cn
▌网站:www.rstats.cn
我们致力于让R语言和统计变得简单!



2023-02-14 16:53
首页    ggplot2    点图