我正在尝试复制我在 FiveThirtyEight 在https://fivethirtyeight.com/features/how-cable-news-reacted-to-the-cohen-hearing/上找到的图表。这显示了一个三元图,其中 3 轴中单词的位置显示了相应网络引用的比例。
我目前正在使用 R、ggplot2,更重要的是 ggtern(我广泛用于三元图)。但是我从来没有找到一种方法来使点上的数据标签不重叠。我一直希望 ggtern 能与 ggrepel 交互,但遗憾的是它没有(据我所知)。有什么方法可以强制它们进行交互,或者找到另一种方法吗?
编辑 代码来创建我可怕的图表:
data <- data.frame(word = c("A","random","set","of","words","that","can","hopefully","help","someone","solve","my","issue","of","overlapping","labels","and","make","my","chart","readable","and","a","good","visualization"),
axis1 = sample(1:100),
axis2 = sample(1:100),
axis3 = sample(1:100))
ggtern(data = data,
aes(x = axis1, y = axis2, z = axis3, colour = word, label = word)) +
geom_point(size = 1) +
geom_text()