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

I am trying to plot using pgfplots from a file containing two colums separated by tabs.

Tweak   Probability
4   0.0065935332
5   0.0006670277
6   0.0002015741
7   6.31090951863062E-005
8   0.000012437
9   0.000003721
10  1.02492049264844E-006
11  2.40164808733254E-007
12  0.000000056
13  1.525040714335E-008
14  0.000000003
15  9.31322573422856E-010
16  4.65661286657218E-010
17  5.82076609134674E-011
18  7.27595761413049E-012
19  7.27595761407755E-012

When I do \addplot table[x=Tweak, y=Probability] { myfile.dat };, I get this error:

! Package pgfplots Error: Could not read table file '" img/doubletweak.dat "'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the pgfplotstable manual for details).

I tried doing what it says, to no avail. When I copy and paste the table and use it in-line, the plot works fine. What might be wrong?

share|improve this question
Start by removing the spaces around the file name: {myfile.dat} – Joseph Wright Oct 22 '12 at 10:23
Ha ha, how stupid. This was the issue. Would you supply answer so I can mark it? – Martin Lauridsen Oct 22 '12 at 11:07
up vote 8 down vote accepted

TeX does not (normally) ignore spaces in arguments. Thus { myfile.dat } and {myfile.dat} are not the same: remove the spaces around the file name and it should be found.

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.