为什么 arXiv 在添加图表时给出“!非法测量单位(插入 pt)。”?

为什么 arXiv 在添加图表时给出“!非法测量单位(插入 pt)。”?

我目前想将我的学士论文提交给 arXiv。它包括以下内容:

\begin{tikzpicture}[scale=1.0]
    \begin{axis}[
        legend pos=north west,
        axis x line=middle,
        axis y line=middle,
        grid = major,
        width=16cm,
        height=8cm,
        grid style={dashed, gray!30},
        xmin=-5,     % start the diagram at this x-coordinate
        xmax= 5,    % end   the diagram at this x-coordinate
        ymin=-1,     % start the diagram at this y-coordinate
        ymax= 1,   % end   the diagram at this y-coordinate
        %axis background/.style={fill=white},
        xlabel=$x$,
        ylabel=$y$,
        tick align=outside,
        enlargelimits=true]
      \addplot[domain=-5:5, green!50!black, ultra thick,samples=500] {x < 0 ? -1 : 1};
      \addplot[domain=-5:5, red, ultra thick,samples=500, dashed] {1/(1+exp(-x))};
      \addplot[domain=-5:5, blue, ultra thick,samples=500, dotted] {tanh(x)};
      \addlegendentry{sign function}
      \addlegendentry{$\sigmoid$}
      \addlegendentry{$\tanh$}
    \end{axis}
\end{tikzpicture}

当我删除行时

      \addplot[domain=-5:5, green!50!black, ultra thick,samples=500] {x < 0 ? -1 : 1};

一切正常。有了这个行,我得到了

LaTeX Warning: Reference `fig:activation-functions' on page 1 undefined on inpu
t line 17.

! Illegal unit of measure (pt inserted).
<to be read again> 
Y
l.39 ...ultra thick,samples=500] {x < 0 ? -1 : 1};

? 
! Emergency stop.
<to be read again> 
Y
l.39 ...ultra thick,samples=500] {x < 0 ? -1 : 1};

! ==> Fatal error occurred, no output PDF file produced!
Transcript written on thesis.log.

[verbose]: pdflatex 'thesis.tex' failed.

有人能解释一下原因吗?可能是因为他们使用了 texlive 2011 (来源) 而我使用 texlive 2015?

我知道我可以通过用以下方法替换情节来解决这个问题

\addplot[green!50!black, ultra thick] coordinates {(-5,-1) (0,-1) (0, 1) (5, 1)};

相关内容