I use pgfplots for the first time, so the error is probably at my end, but I was under the impression that xlabels from data={\table}{colname} could be used to set strings from a data table as x-labels. However, when I try it, it does nothing at all, the labels are still numbers (maybe it has to do with x expr=\coordindex, but that is also not what is printed).
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\begin{filecontents}{data.dat}
fname foo
one 1
two 2
three 3
\end{filecontents}
\begin{document}
\pgfplotstableread[col sep=space]{data.dat}\datatable
\begin{tikzpicture}
\begin{axis}[
xlabel={Image Number},
ylabel={Distance ratio}
]
\addplot table[
xticklabels from table={\datatable}{fname},
x expr=\coordindex,
y=foo,
] {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}
How do I correctly use the key /pgfplots/xticklabels from table?

