I am not sure why naming a plot in a tdoes not seem to work for me.
This works without using name in the addplot line:
$graph_imageb = createTikZImage();
$graph_imageb->texPackages(["pgfplots"]);
$graph_imageb->BEGIN_TIKZ
\begin{axis}[
xmin=-3, xmax=3,
ymin=-10, ymax=10,
xtick distance=1, ytick distance=4 ]
\addplot[blue, ultra thick] (x,5*x*x-2*x);
\end{axis}
END_TIKZ
But changing the addplot line to include name does not: \addplot[name path=F, blue, ultra thick] (x,5*x*x-2*x);
Ultimately I wish to use the names to fill in between two graphs.