I just can't make the command plot in TikZ work. For example, even such basic code as
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$y$};
\draw[color=red] plot (\x,{\x}) node[right] {$f(x)=x$};
\end{tikzpicture}
\end{document}
produces this error, with no PDF output:
ERROR: Package tikz Error: Cannot parse this plotting data.
If it can be of any help, in the .log file I found this message:
Missing character: There is no , in font nullfont!
! Undefined control sequence.
l.11 \draw[color=red] plot (\x,{\x
}) node[right] {$f(x) =x$};
If I comment out the line containing the plot command, things compile nicely.
Interestingly, if I include \usepackage{pgfplots} in the preamble, then I get a different error message in ltluatex.tex:
ERROR: Undefined control sequence.
--- TeX said ---
l.55 \ifnum\luatexversion
<60 %
Btw, I am running TeX Live 2017 on a MacBook Pro. Any help would be greatly appreciated.
UPDATE: Following @Torbjørn T.'s suggestion, I have removed the old version of TikZ from my local tree. While plot is still not working, at least the error message has changed. Now it's:
ERROR: Undefined control sequence.
--- TeX said ---
l.533 \pgfset
{
The error refers me to the file pgfmoduleshapes.code.tex (2008/02/13 (rcs-revision 1.4)). Thanks in advance.
\RequirePackage{luatex85}but beside this your code compiles fine and doesn't give your error message. Can you show the log-file? – Ulrike Fischer Feb 10 '18 at 18:56standalone– sergiokapone Feb 10 '18 at 19:02\usepackage{luatex85}after\documentclass? – sergiokapone Feb 10 '18 at 19:12\RequirePackage{luatex85}goes before\documentclass. Your code works fine here as well, with eitherlualatex,xelatexorpdflatex. – Torbjørn T. Feb 10 '18 at 19:23.logfile, you have a quite old version of TikZ in your local tree (/Users/sns/Library/texmf/tex/latex/misc/pgf-1.01/latex/pgf/), that is being used instead of the one in/usr/local/texlive/2017/. Could be that if you remove the one in your local tree, it would work. – Torbjørn T. Feb 11 '18 at 22:12