我正在尝试使用Rstudio中的GGiraph绘制一个绘图列表。绘制多个绘图的解决方案是通过Cowplot (ggobj = plot_grid(plot1, plot2))或Patchwork (code = print(plot / plot))。如果您单独打印单个打印,则此方法有效。但是,它看起来不接受绘图列表。我希望这些图排列在一列多行中。
有谁有解决这个问题的办法吗?
发布于 2020-07-06 19:04:22
您可以尝试在plot_grid中使用plotlist参数。
#Using the example from giraffe
library(ggiraph)
library(ggplot2)
dataset <- mtcars
dataset$carname = row.names(mtcars)
gg_point = ggplot( data = dataset,
mapping = aes(x = wt, y = qsec, color = disp,
tooltip = carname, data_id = carname) ) +
geom_point_interactive() + theme_minimal()
#using the plotlist argument
library(cowplot)
girafe(ggobj = plot_grid(plotlist=list(gg_point, gg_point), ncol=1))https://stackoverflow.com/questions/62710749
复制相似问题