0

我希望用来plotly::ggplotly()绘制ggtern()使用工具提示功能生成的图形。但是加载包 ggtern 导致 ggplotly 抛出以下错误:

继承错误(主题[[元素]],ggplot_global$element_tree[[element]]$class):'what'必须是字符向量

更重要的是,所有图表都会出现此错误,而不仅仅是 ggtern 生成的图表。

这是一个例子。

library(ggplot2)

# This works
gg.mtcars <- ggplot(mtcars, aes(hp, mpg)) +
  geom_point()
plotly::ggplotly(gg.mtcars)

library(ggtern)

data("Feldspar")

gg.feldspar <- ggtern(data = Feldspar, aes(x = Ab, y = An, z = Or)) +
  geom_point()

# This throws an error
plotly::ggplotly(gg.feldspar)

# And now this throws an error too
plotly::ggplotly(gg.mtcars)
4

0 回答 0