[Tex/LaTex] n advantage to using LaTeX graphics instead of eps or pdf

diagramsgnuplotgraphics

Back in my first courses I learned that the best graphic format to use when plotting data with gnuplot (which will later be used in a LaTeX document) is eps (encapsulated postscript). I didn't really learn why, though.

Lately, I was reading through gnuplot's documentation and I found out it can save plots not only in LaTeX format, but also in emtex, pstex, pslatex and texdraw (besides many others, of course).

My question is: Given that the image's ultimate fate is to be inserted in a latex document, wouldn't one of these formats be more suitable than eps (or the more recent pdf)?

By suitable I mean having more features and better final output (alignment, positioning, fonts, etc).

Best Answer

In the past EPS was a good format to use for plots because it stored vector graphics. It doesn't make sense to save plots as raster images. However, nowadays PDF, which is kind of the successor of PS, is the better format. It also supports vector graphics, font inclusion and also raster images. Because it is binary it normally takes much less space than EPS files. Also PDF is by design easier to display because you don't need a complex language interpreter as for (E)PS.

If you take Gnuplot and select LaTeX output, you will get some LaTeX code, which draws the plot, but this doesn't mean it is the best possible result. Automatically generated LaTeX code (or for any other language) is often very limited. I wasn't happy after testing the LaTeX output of Gnuplot the last time.

I would try to go with PDF output (i.e. pdfcairo with my Gnuplot under Linux) and see if the quality is good. If you use the modern pdflatex you can use these PDF files directly in your document.

Another approach entirely is to draw the plot directly using LaTeX. Both PGF/TikZ and PSTricks allow for generating plots out of data files. Then you can ensure that the used fonts match the one in the rest of the document and can easily use LaTeX symbols in the labels.