[Solved] Print dynamic numbers

Tohiko Asks: Print dynamic numbers
I want to plot some calculated numbers in a pgfplots axis. I tried the following:

Code:
documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=newest}
begin{document}
begin{tikzpicture}
  begin{axis}
    pgfplotsforeachungrouped i in {1,...,5}
    {
      addplot []
      coordinates{(i,i/2)}
      node[pos=1,right] {pgfmathparse{int(i*2)}pgfmathresult};
    };
  end{axis}
end{tikzpicture}
end{document}

First, is this the right way to print text in pgfplots? i.e. using addplot?

More importantly, the output at the moment is showing up at 13 everywhere. Evidently the expression is evaluated at the end after i becomes 6.

How can I do this correctly?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.