I found another solution that allows you to set the size of the graph, even when you create graphs inside a function or loop:
pl <- ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + geom_point() print(pl, vp=grid::viewport(width=unit(10, 'inch'), height=unit(8, 'inch'))
source share