To reduce the space between subplots use panel.margin=
in theme()
, for example
library(grid)
+theme(panel.margin=unit(0,"cm"))
To set unit()
you should use library grid
.
The size of each subplot will depend on size of tho whole plot. You can set the size of whole plot using ggsave()
function to save plot in some of formats (pdf, jpg) and setting width=
and height=
of whole plot.