# LuaTeX, unable to read file in pgfplots

I am trying to switch to LuaTeX, but I am not able to compile any pgfplots figures with external data files, which used to compile with pdflatex. Here is the MWE:

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[]
\end{axis}
\end{tikzpicture}

\end{document}


With the plot file.

0    1
1    2
2    3
3    4
4    5


With pdflatex this works fine, which means that pgfplots should be able to read the file. But when I use LuaLaTeX it raises the following error:

! Package pgfplots Error: Could not read table file 'plot'.
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).


Any help would be appreciated.

• Do you have any extension for plot? May be plot.dat or plot.txt? I find no problem here.
– user11232
May 4 '15 at 9:19

I can reproduce the error with lualatex if I use plot instead of plot.dat or plot.txt. Try with the file extension like \addplot[black] table {plot.dat};.

\documentclass{standalone}
\usepackage{pgfplots}

\usepackage{filecontents}
\begin{filecontents*}{plot.dat}
0    1
1    2
2    3
3    4
4    5
\end{filecontents*}

\begin{document}

\begin{tikzpicture}
\begin{axis}[]
\end{axis}
\end{tikzpicture}

\end{document}


With \addplot[black] table {plot};, it won't work with pdflatex too. For more on the these see this question and its answers (Thanks to Ulrike Fischer for the link).

• May 4 '15 at 9:23
• Thank you both, since i work on linux i was not aware that not using any file extension would be ever problematic. May 5 '15 at 9:56