问题描述
我正在尝试使用 8
绘制 ggplot objects
ggarrange
以便它在每一行中绘制 4
ggplot 对象。代码工作正常,但现在我希望以一种方式绘制情节,使情节占据标签和情节之间的额外空白,例如情节占据标签 A 和该情节之间的空白,以及其余的情节依此类推。基本上,我想拉伸绘图,因此使用了网格中的所有可用空间。我该怎么做?
gg.arrange = ggarrange(ggplot1,ggplot2,ggplot3,ggplot4,ggplot5,ggplot6,ggplot7,ggplot8,ncol = 4,nrow = 2,labels = c("A","B","C","D","E","F","G","H"),common.legend = TRUE,legend = "bottom")
ggplot 对象之一的代码:
ggplot1 = ggplot(shapefile_sf_object) +
geom_sf(aes(fill = Data),show.legend = T) +
coord_sf() +
geom_sf(data = DEM_sf,aes(size = DEM),shape = 1,show.legend = T) +
theme(axis.text.x = element_text(angle = 90)) +
scale_fill_distiller(palette = "Spectral") +
labs(title = "February",fill = "RMSE")