I was wondering if is possible to have latex labels in Gnuplot but with pdf output instead .tex
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
I may reply a bit too late, however, I had the same problem and I've found the solution here.
Basically you need to add a single additional key "standalone" to your terminal definition. I provide a MWE below (script.gp):
set terminal epslatex size 3.5,2.62 standalone color colortext 10 set output 'example.tex' plot sin(x)
After that you run three more commands:
gnuplot script.gp latex example.tex dvips -o example.ps example.dvi
Finally, you can convert the resulting file to pdf. This is probably not the most optimal way to do what you need, however, it works.
UPDATE: Actually, that was a very long way to do this due to my lack of experience. You can reduce the number of steps like this:
gnuplot script.gp latex example.tex dvipdf example.dvi example.pdf
However, for some reason
dvipdf started giving an empty pdf document some time ago (and I have no desire to dig deeper).
You also can use latex directly through
pdflatex, however, I get two pdf output files, one of them has no labels at all.
Yes, it is possible. Gnuplot has so called epslatex terminal, which outputs labels in latex and the plot in eps. LaTeX graphics package can automatically convert eps to pdf.
Leyla Akhmadeeva and I wrote a paper about this for TUGboat: http://tug.org/TUGboat/tb34-3/tb108veytsman.pdf