I can’t believe I just came across something so simple, but I’m glad I did. I do all of my plotting in gnuplot and all of my presentation in LaTeX with the Beamer class. Here is what I do to get plots from gnuplot into LaTeX and it’s much simpler than what I used to do (it should be noted that I do all of my LaTeX in gedit, this might not compile the same way in other programs.

1. Output the plot from gnuplot as an .eps image with the following added at the beginning of your .plt file:

set term postscript
set output “/home/user/plot.eps”

2. Move the image into the folder where your .tex file is and run:

epstopdf plot.eps

to create a .pdf of your image.

3. Add the new .pdf as you would any graphic in LaTeX.

Why would I even bother writing something so simple? Because before I tried this I was compiling my LaTeX file like 4 times while also running some other scripts that converted the .eps file to a .ps then to a .dvi then finally to a .pdf. This cut out all of those steps, AND, the resulting .pdf from the epstopdf script looks much clearer than any method I have tried previously. If anyone knows anything simpler, please let me know. The Debian package that contains the epstopdf script can be found here.

Advertisements