Get rid of the white space around matlab figure's pdf output

Viewed 73183

I'd like to use PDF versions of my matlab plots in a LaTeX document. I'm saving the figures using the "saveas" command with the PDF option but I get huge white space around my plots in the pdf files. Is this normal? How can I get rid of it? Automatically, of course, since I have "a lot" of plots.

17 Answers

Using pdfcrop is another solution. Simply cd to the folder where all your pdf are saved and run

for i in *;do pdfcrop "$i";done

The only problem is pdfcrop is not available for Windows. So I run it from Windows Subsystem for Linux (WSL).

Related