I use tikz/pgf to plot plots with data from a file. This works perfectly fine if I have at least to columns in the file that I can choose from. However, I have a rather huge file with just one column. This should represent the y-axis. The x-axis should be just the number of the entry/row/line. I wonder why gnuplot can handle this easily but I have problems getting this run with tikz/pgf. Here is one approach that does not work:
\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot plot file {lala};
\end{axis}
\end{tikzpicture}
\end{document}
And here's another one that does not work:
\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table[y index=0] {lala};
\end{axis}
\end{tikzpicture}
\end{document}
'lala' looks like this:
10
9
3
2
It should be an easy one, but all the examples I find are with at least two columns.
Thanks in advance,
o
/edit: Sorry, I forgot about the error message:
Runaway argument?
\else \expandafter \pgfplots@addplotimpl@file@readall \fi \fi \pgfplots@coord@s
tream@end \ETC.
! Paragraph ended before \pgfplots@addplotimpl@file@parsesingle was complete.
<to be read again>
\par
l.15
/edit2: After Jake's comment, I run the following example:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table [x expr=\coordindex,y index=0] {lala.dat};
\end{axis}
\end{tikzpicture}
\end{document}
Unfortunately it gives me the following error message:
! Package pgfkeys Error: I do not know the key '/tikz/x expr' and I am going to
ignore it. Perhaps you misspelled it.
This person has the same error message. It is obviously because of my old texlive (2009) which is installed on my Linux Mint 12 (Ubuntu 11.10). I'll try to install texlive2010.


=)– Jake Sep 13 '12 at 20:37