未定义的控制序列。\pgfplots@already@computed@legend@node

未定义的控制序列。\pgfplots@already@computed@legend@node

我的电脑只出现以下错误。

Undefined control sequence.
\pgfplots@already@computed@legend@node ..._{\text 
                                                  {des}}$};\\\pgfplots@show@...
l.261 \end{axis} 

这是代码

\begin{tikzpicture}

\begin{axis}[%
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=0, xmax=20,
xlabel={Time (s)},
ymin=-10, ymax=10,
ylabel={Angle (deg)},
name=plot2,
title={(b)},
legend style={draw=black,fill=white,legend cell align=left}
]
\addplot [
color=red,
solid,
line width=1.0pt
]
table{
0 -5
 .
 .
20 -5
};
\addlegendentry{$\theta{}_{\text{des}}$};

相关内容