12.17 椭圆图

type 指定多元分布的类型,type = "t"type = "norm" 分别表示 t 分布和正态分布,geom = "polygon",以 eruptions > 3 分为两组

ggplot(faithful, aes(x = waiting, y = eruptions)) +
  geom_point() +
  stat_ellipse()

ggplot(faithful, aes(waiting, eruptions, color = eruptions > 3)) +
  geom_point() +
  stat_ellipse(type = "norm", linetype = 2) +
  stat_ellipse(type = "t") +
  theme(legend.position = "none")

ggplot(faithful, aes(waiting, eruptions, fill = eruptions > 3)) +
  stat_ellipse(geom = "polygon") +
  theme(legend.position = "none")
几种不同的椭圆图几种不同的椭圆图几种不同的椭圆图

图 12.58: 几种不同的椭圆图