4

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}

\pgfplotsset{width=6cm, compat=newest}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[]
        \addplot[black] table {plot};
    \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.

1
  • 1
    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
3

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}

\pgfplotsset{width=6cm, compat=newest}
\usepackage{filecontents}
\begin{filecontents*}{plot.dat}
  0    1
1    2
2    3
3    4
4    5
\end{filecontents*}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[]
        \addplot[black] table {plot.dat};
    \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

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).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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