r-tmap/tmap

tmap_grob not working well with gridExtra::grid.arrange

Opened this issue · 0 comments

library(ggplot2)
library(gridExtra)

g1 = ggplot(iris) + geom_point(aes(x = Sepal.Length, y = Sepal.Width))
tm1 = tm_shape(World) + tm_polygons()

gridExtra::grid.arrange(tmap_grob(tm1), g1, nrow= 1)

image

Working well:

# working well
library(grid)
grid.newpage()

pushViewport(viewport(layout = grid.layout(1,2)))

print(tm1, vp = viewport(layout.pos.col = 1, layout.pos.row = 1))
print(g1, vp = viewport(layout.pos.col = 2, layout.pos.row = 1))

image

Triggered by edzer/sdsr#119 (comment)