2

I am creating a PDF in an R markdown file, and I have the following chunk:

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))

The relative dimensions look good, but when I knit the document, the plots are too small. How do I change the absolute width and height of the plots?

Thanks in advance.

John Smith
  • 393
  • 1
  • 6
  • 17
  • 1
    In order to make the example [reproducible](https://stackoverflow.com/q/5963269/3250126) please add all necessary libraries etc. – loki Jul 24 '17 at 13:42
  • why not change the figure height and widths with the chunk arguments. – user20650 Jul 24 '17 at 18:27

0 Answers0