I'm trying to plot something using atan in pgfplots, but it always results in hundreds of errors.
I'm using an example I found here:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\pgfplotsset{compat=1.9}
\begin{tikzpicture}
\begin{axis}[
width=160pt,compat=1.5.1,grid style={ultra thin},every axis plot post/.append style={thick},
x tick label style={font=\tiny},y tick label style={font=\tiny},
scale only axis,grid=major,axis lines=middle,
xlabel={$x$},
ylabel={$y$},
xmin=-200,
xmax=200,
domain=-200:210,
ymin=-5.5,
ymax=5.5,
xtick={-150,-100,...,150},
ytick={-5, -4,...,5},
restrict y to domain=-20:20,
legend style={at={(0.5,-0.05)},anchor=north,nodes={right}},
]
\addplot[mark=none,color=blue, samples=500]{rad(atan(x))};
\addlegendentry{$y = \tan^{-1}x $};
\end{axis}
\end{tikzpicture}
\end{document}
The errors are:
! Undefined control sequence.
<recently read> \pgfmath@multiply@thousand
l.23 ...ne,color=blue, samples=500]{rad(atan(x))};
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfmath@basic@atan@ ... pt \pgfmath@table@lookup
{\pgfmath@x }{pgfmath@atan...
l.23 ...ne,color=blue, samples=500]{rad(atan(x))};
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
}
l.23 ...ne,color=blue, samples=500]{rad(atan(x))};
And it goes on and on. Over hundred errors and then it stops compiling with no result at all. What am I doing wrong here?
\pgfplotsversionsomewhere after the\begin{document}to see what it is. Latest version is 1.11 – percusse Dec 14 '14 at 14:11Maybe someone can find the problem.
– ElBartoME Dec 14 '14 at 14:19