grid.arrange中的绝对宽度和高度

时间:2017-07-24 13:32:47

标签: r grid width markdown dimension

我在R markdown文件中创建PDF,我有以下块:

PR_googlemap <- get_googlemap(center = c(lon = median(c(-67.95, -65.17)), lat = median(c(17.86,  18.41))), zoom = 9)


 a <- ggmap(PR_googlemap,  extent = "device") +
   geom_point(data = subset(PR_2016_boat_logs, grepl("X", fieldid) == TRUE | grepl("J", fieldid) == TRUE), aes(x = lon, y = lat), size = 3, color = "red") +
   annotate(geom = "text", label = "Benthics", y = 17.4, x = -66.5)

 #b <- ggmap(PR_googlemap,  extent = "device") +
 #  geom_point(data = subset(PR_2016_boat_logs, grepl("J", fieldid) == TRUE), aes(x = lon, y = lat), size = 3, color = "blue") +
 #  annotate(geom = "text", label = "LPI / Benthic Cover", y = 17.4, x = -66.5)

 c <- ggmap(PR_googlemap,  extent = "device") +
   geom_point(data = subset(PR_2016_boat_logs, grepl("A", fieldid) == TRUE | grepl("B", fieldid) == TRUE), aes(x = lon, y = lat), size = 3, color = "darkgreen") +
   annotate(geom = "text", label = "Fish", y = 17.4, x = -66.5)

 blank<-rectGrob(gp=gpar(col="white")) 

grid.arrange(a, blank, c,  nrow =3, heights = c(2, 0.2, 2))

相对尺寸看起来不错,但是当我编织文档时,图表太小了。如何更改图的绝对宽度和高度?

提前致谢。

0 个答案:

没有答案