1

我正在编写一个脚本来显示三元图中植物物种在 3 个不同类别中的生长程度,但我最大的问题是,所有点都与其他点完全重叠,有时很少有时很多。我想计算它们并在我的图例中显示所有数量,最好在图中显示不同的形状或大小。这里的问题是,我对 R 相对缺乏经验,到目前为止,我有 3 个类别,它们是 50,100 和 150。我想要的甚至可能吗?

到目前为止我的代码:

ggtern(data=Anthurium_R, aes(x=Epiphytic, y=Lithophytic, z=Terrestrial)) +
  geom_mask() + 
  geom_point(alpha=0.15, size=5, shape=4, color="blue") + 
  geom_count(mapping = NULL, data = NULL, stat = "sum", position = "identity",na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +
  scale_size_area(max_size = 4) +
  limit_tern() +
  labs(title = "Plant life form distribtuion for clusiaceae") + 
  theme_arrowlarge() +
  theme(plot.title = element_text(hjust = 0.5))

剧情:

在此处输入图像描述

编辑:现在我阅读了更多关于 geom_count 的内容,基本上我想要的是每个点都有一个“n”,如果可能的话,我想将 n 重命名为“植物数量”

4

0 回答 0