Putting Octave Plots in LaTeX


I like vector based formats for my plots if the data is vector based. I input png and pdf to latex. I can output png, eps and pdf from Octave. The problem is that the pdf outptut has extra whitespace. To get around the whitespace, I can copy and paste into powerpoint and save as pdf with a specific page size or I can do the following.

Plot the figure with size on paper set

> fh = figure(‘papersize’,[6 4],’paperposition’,[0 0 6 4]);

Output as a colored encapsulated postscript

> print(‘-depsc2′,’figure.eps’)

Turn EPS to a PDF with proper size. You can edit the pdf later if need be.

$ ps2pdf -dEPSCrop figure.eps

Add figure to paper with proper size

\usepackage{graphicx}

\includegraphics[width=6in]{figure.pdf}

References

ps2pdf bounding box & page size problem – LinuxQuestions.org

  1. No comments yet.
(will not be published)