Try this feature:
savepdf <- function(file, width=16, height=10) { fname <- paste("figures/",file,".pdf",sep="") pdf(fname, width=width/2.54, height=height/2.54, pointsize=10) par(mgp=c(2.2,0.45,0), tcl=-0.4, mar=c(3.3,3.6,1.1,1.1)) }
You can also trim the gap in the resulting PDF file after creating it. On Unix, the system command:
pdfcrop filename.pdf filename.pdf
pdfcrop works on Mac if the standard LaTeX distribution (Mactex or texlive) is installed. Of course, this command can be executed in R as follows:
system(paste("pdfcrop", filename, filename))
source share