TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

maybe I do not to see the wood for the trees, but I'm always getting error messages for compiling the following pgf code, while the output looks like the way it should. Does anyone see whats wrong with my code? (download tex-file and test.dat)



every axis legend/.append style={draw=none, font=\scriptsize, column sep=5pt},    


    xlabel=Lautanzahl pro 150 Wörter,
    enlarge x limits=0.07,
    enlarge y limits=0.07

    \addplot [black, only marks, mark options={scale=1}, mark=*] file {test.dat};



share|improve this question
I got it! After changing the files encoding from "Unicode UTF-8" to "Western (Windows Latin 1)" and the end-of-line-format from "Mac (CR)" to "Windows (CRLF)" it compiles without any errors. Does anyone know whats behind all that? – MaKa TaBo Jun 12 '11 at 16:35

I backtraced through TeX's step and found that it had problems with the very first entry of test.dat -- instead of 477, it found something strange. A more detailed look into the file revealed that it contained a Byte Order Mark (unicode-specific).

I opened the file in vim and used set nobomb (no byte order mark) and saved the file. Afterwards, it worked.

Apparently, pgfplots does not work with data files containing byte order marks.

Anyway, the Mac file ending has nothing to do with it - and the UTF-8 is also fine, as long as you do not include a byte order mark (but as a side effect, the switch to latin1 also removed the bom).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.