I tried to make a plot with data from a .txt file. The part with gnuplot works, but bringing the diagramm to Latex is frustrating. That's what I do:


set terminal epslatex size 10cm,5.8cm
set output 'Messw1.tex'
plot '~Long Filepath~/mydata.txt' notitle with lines

Now there are to files in "My Documents" (On partition C, in case it matters. TexLive 2012 and Gnuplot are on a different Partition.): "Messw1.tex" and "Messw1.eps".

-- LATEX --



    \input{~Long Filepath~/Messw1}


That's the first time in latex I have not the slightest idea, how I can make it work. :) Desperately needing help!

  • 1
    For me it seems that question gnuplot and pdflatex can help you ...
    – Mensch
    Mar 11, 2013 at 21:11
  • What is the problem using the above code? Please update your answer to include the log of (pdf)latex.
    – user26372
    Mar 11, 2013 at 22:29
  • @ Kurt: I know all these threads about gnuplot. In this case, I can't even compile the example in the accepted answer.
    – Josephus
    Mar 11, 2013 at 22:46
  • @Josephus if it's not confidential, can you post mydata.txt file via dropbox here or any dummytext.txt which creates the problem. also post the Messw1.log, it's difficult to diagnose unless one knows the full symptoms. Mar 12, 2013 at 0:33
  • For a quick start: Use the pdf output of gnuplot instead of eps. Then copy the resulting file into the directory where the latex file is located, include the graphics with \includegraphics{filename.pdf} instead of \input...
    – Alexander
    Mar 12, 2013 at 11:15

2 Answers 2


Some points, that come to my mind:

  • I would wonder, whether the classic (dvi)latex, dvips, ps2pdf route works for you? This is mostly to make sure, that it is actually a pdflatex problem and not something else.
  • It sometimes can be a problem if .tex/.eps files are not in a subdir of the main document or the like. Could you copy messw1.tex, messw1.eps into the same directory as your main document and \input messw1.tex?

Alternative options

Not really answering your question now, but if you want some high quality graphs in your document, that use tex for labels, you might want to take a look at GLE.

  • 1
    Oh my gosh! I didn't know, the .tex and .eps files of the plot have to be in the same directory of the compiling .tex file. I always had them somewhere entirely else. I know it's a fundamental thing you'd assume others would know; to such an extend that nobody writes about it. Many thanks! :D It does work now, if they are in the very same directory, like \input{Messw1} but doesn't work when I put the .eps/.tex files in a subdirectory "Diagrams" with \input{Diagrams/Messw1} ,saying LaTeX Error: File 'Messw1' not found.
    – Josephus
    Mar 12, 2013 at 15:05
  • 1
  • I wonder, whether \input Diagrams/Messw1.tex (with .tex and no {}) works?
    – Elrond
    Mar 13, 2013 at 9:11
  • @ Elrond: No, still can't use subdirectories. This leaves me rather unsatisfied, but at least it works at all.
    – Josephus
    Mar 15, 2013 at 17:33
  • Is it the .tex file that is not found? Or the autogenerated pdf? I know that I had weird issues with epstopdf and subdirectories. The solution for me was to add \epstopdfsetup{outdir=./} to the preamble.
    – ergoen
    Mar 28, 2013 at 13:45

Just make gnuplot output PDF, or transform the EPS to PDF somehow. pdflatex doesn't handle eps or ps figures.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .