If I do a very simple ggplot as an example:
library(ggplot2) ggplot() + geom_rect(aes(xmin = 0, xmax = 1, ymin = 0, ymax = 1), fill = 'red', colour = NA) + coord_fixed(expand = 0)+ theme(axis.ticks = element_blank(), axis.text = element_blank(), plot.margin = unit(c(0, 0, 0, 0), 'cm'), axis.title = element_blank())
So I've used the expand=0 option to coord_fixed and some theme settings to remove whitespace within and around the plot.
I seem to still have small amounts of space to the left and bottom of the plot. I'd like to reduce this to only the plot area (ie, in this simple example, just a red square). What haven't I removed?
Thanks in advance for your help.