我不明白为什么以下代码不起作用。我收到错误:
./tabtest.tex:37: 未定义控制序列。
<argument> \xc
,\yc
l.37 \end{axis}
\documentclass{scrartcl}
%
\usepackage{pgfplotstable,tikz,filecontents}
%
\begin{document}
\begin{filecontents}{data.txt}
0.84661730E-01 0.53453308E+00 -
0.37594643E+00 0.38930386E+00 +
0.54111367E+00 0.94450973E-02 +
0.38930386E+00 -0.37594646E+00 -
0.94450731E-02 -0.54111367E+00 -
-0.37594652E+00 -0.38930380E+00 +
-0.54111367E+00 -0.94451150E-02 +
-0.38930374E+00 0.37594658E+00 -
\end{filecontents}
%
\begin{tikzpicture}
\begin{axis}[axis equal, axis lines=none, xmin=-1, xmax=1, ymin=-1, ymax=1, clip=false]
\coordinate (OP) at (0,0);
\draw [black] (OP) circle (1);
%
\pgfplotstableread[header=false]{data.txt}{\datatable}
\pgfplotstablegetrowsof{\datatable}
\pgfmathsetmacro{\rownum}{\pgfplotsretval-1}
%
\addplot[mark=none] table {\datatable};
%
\foreach \angle in {0,...,\rownum}{%
\pgfplotstablegetelem{\angle}{[index]0}\of{\datatable}
\let\xc\pgfplotsretval
\pgfplotstablegetelem{\angle}{[index]1}\of{\datatable}
\let\yc\pgfplotsretval
\pgfplotstablegetelem{\angle}{[index]2}\of{\datatable}
\let\ps\pgfplotsretval
\node at (\xc,\yc) {\ps};
}%
\end{axis}
\end{tikzpicture}
\end{document}