I am using ggplot2 in creating an R package. How can I select plot panel only? The code below does not work any more.
# Get the ggplot grob
gt = ggplotGrob(p)
# Select plot panel only
gt = gt[3,4]
And if I use theme() such as theme(plot.margin=unit(c(0,0,0,0), "null"))+ theme(panel.margin=unit(c(0,0,0,0), "null")), there are still some margins when I save the plot. Is there a way to eliminate plot margins and panel margins completely? Could you give me a hint?
Please see the link below for more details.
Thank you very much in advance!