【发布时间】:2016-01-02 11:55:39
【问题描述】:
我想使用带有 grid.arrange 的 ggplot2 来生成多个带有 plotly 的绘图。 类似这样的东西:
library(ggplot2)
library(gridExtra)
library(plotly)
g1<-ggplot(mpg, aes(displ, hwy, color=factor(year)))+geom_point()
g2<-ggplot(mpg, aes(cyl, hwy, color=factor(year)))+geom_point()
g<-grid.arrange(g1,g2,ncol=2)
ggplotly(g)
但是,我收到“gg2list(p) 中的错误:绘图中没有图层”
任何建议
【问题讨论】:
-
我什至无法在 R 3.1.3 中安装。你用的是什么版本?