0

我正在尝试使用ggtern创建并排比较两个三元图的图像。创建图后,当我尝试使用 来排列它们时grid.arrange(),我收到以下错误:

Error: CoordTern requires the following missing aesthetics (tlr->xy) : z

以下代码重现了该错误:

library(ggtern)

plotA <- ggtern(data.frame(x = 1, y = 1, z = 1), aes(x, y, z)) + geom_point()
plotB <- ggtern(data.frame(a = 1, b = 1, c = 1), aes(a, b, c)) + geom_point()

plots <- grid.arrange(plotA, plotB, ncol = 2)
# using ggtern's arrangeGrob() throws the same error:
# plots <- arrangeGrob(plotA, plotB, ncol = 2)

如何为 提供美学grid.arrange()或以其他方式修复此错误以便显示我的图?

4

0 回答 0