相关疑难解决方法(0)

将常规绘图对象强制转换为Grob,以便在grid.arrange中使用

b <- ggplot(cars,aes(x=speed,y=dist))+geom_line()
grid.arrange(
    b,
    plot(cars),
    ncol=1
)
Run Code Online (Sandbox Code Playgroud)

给我以下错误

gList中的错误(列表(grobs = list(list(x = 0.5,y = 0.5,width = 1,height = 1,:"gList"中只允许'grobs')

让我们假设我的第二个图必须从plot函数中出来.如何将该输出转换为类似grob对象,以便它可以很好地运行grid.arrange

plot r ggplot2 gridextra grob

11
推荐指数
1
解决办法
3776
查看次数

标签 统计

ggplot2 ×1

gridextra ×1

grob ×1

plot ×1

r ×1