tikz externalize 和 pgfmath 错误

tikz externalize 和 pgfmath 错误

同时使用external和会导致\pgfmathdeclarefunction

! Illegal parameter number in definition of \pgfmathfloat@expression.
! Package PGF Math Error: Could not parse input '' as a floating point number, sorry. The unreadable part was near ''. (in '##1').

这是一个 MWE

\documentclass{article}
\usepackage{pgfplots}\usetikzlibrary{external}
\begin{document}
\tikzexternalize
\begin{tikzpicture}
\pgfmathdeclarefunction{f}{1}{\pgfmathparse{#1}}
\begin{axis}
\addplot {f(x)};
\end{axis}
\end{tikzpicture} 
\end{document}

是什么导致了这些问题?我该如何解决?

相关内容