This code snippet defines a simple function using \pgfmathdeclarefunction (e.g. f()) and \pgfmathparse. I would like to use the defined function f() within other coordinate, e.g. (0.2, f(0.2)) vs. (0.2, f(0.2). Note the latter has one fewer ). Both usage do plot the dot, but the former results pgfplots error:
error| Package pgfplots Error: Sorry, I could not read the plot coordinates near ')'
I would like to know are these usage of defined function f() correct?
\begin{tikzpicture}
\pgfmathdeclarefunction{f}{1}{%
\pgfmathparse{#1}%
}
\begin{axis}[xmin=0, xmax=1, ymin=0, ymax=1,]
% this draw the plot, but also report an error
\addplot[mark=*, blue] coordinates {(0.2, f(0.2))};
% this works
\addplot[mark=*, blue] coordinates {(0.2, f(0.2)};
\end{axis}
\end{tikzpicture}
