I am attempting to create plot labels whose positions are determined by a function. The root problem is that the labels do not stay where they are placed, but all of the them move to the position of the label last placed.
\documentclass[11pt]{article}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\begin{document}
\def\MyFunction(#1, #2){(#1/1000)^2 * (#2/1000)^2 * 175}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
[
width=12cm, grid=major,
ymin=0, ymax=30,
xmin=0, xmax=1000, domain=0:1000, samples=100
]
\edef\L{450}
\addplot [solid] {\MyFunction(\L, x)};
\pgfmathparse{\MyFunction(\L, 500)}
\edef\tmp{\pgfmathresult}
\node[anchor=south west, fill=white, fill opacity=0.5] (pt450) at ($(axis cs:500,\tmp)+(0.5cm,-0.5cm)$) {\L 1st};
\draw[->](pt450.south east)--(pt450.south west)--(axis cs:500,\tmp);
\edef\L{620}
\addplot [solid] {\MyFunction(\L, x)};
\pgfmathparse{\MyFunction(\L, 500)}
\edef\tmp{\pgfmathresult}
\node[anchor=south west, fill=white, fill opacity=0.5] (pf620) at ($(axis cs:500,\tmp)+(0.5cm,-0.5cm)$) {\L 2nd};
\draw[->](pf620.south east)--(pf620.south west)--(axis cs:500,\tmp);
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
My end goal is to use \foreach to have several plots (with labels) generated without the redundancy of code, which is why I am not using different variable names for the second instance. Yes, I will be generating dynamic node names, but removed that here for simplicity.
I'm also open to alternate methods of placing the labels, because this method does seem more complex than it might have to be.

\pgfplotsinvokeforeachor\pgfplotsforeachungrouped. The details depend a bit on your requirements: Do the labels need to be positioned on a case by case basis, as in your example? Then you'll probably need to go with\pgfplotsforeachungroupedand an\edef. Could you elaborate a bit on what you're aiming to do? – Jake Dec 3 '12 at 19:32