; August 2012 | Michael Ian Lapsley

Save figures to PDF in MATLAB (or octave)

I used to use a program that someone developed called fig_setpdf.m, which gives some options about saving to a pdf. More recently I found that you can simply use the print command to generate a pdf. This does not give the options of fig_setpdf, but it can be easily implemented. (In fact that is how fig_setpdf works)

Here is a simple example of how to create a pdf from the current figure.

        Psize = ([85 70]/25.4)
        set(gcf,'PaperSize',Psize,'PaperPosition',[0 0 Psize])
        print('Plots135k/Simulation_135k','-dpdf')