Is there a reason why the code below leads to the error:
! Illegal unit of measure (pt inserted).
<to be read again>
e
l.16 ...t [domain=-.1:.1,samples = 100] (\x,{G(\x)})
\documentclass[tikz]{standalone}
\directlua{
function G (x)
return (-(x^2)/3)
end
}
\pgfmathdeclarefunction{G}{1}{%
\edef\pgfmathresult{\directlua{tex.print("" .. G(#1))}}%
}
\begin{document}
\begin{tikzpicture}
\draw [blue] plot [domain=-.1:.1,samples = 100] (\x,{G(\x)});
\end{tikzpicture}
\end{document}