I'm trying to make a bar plot for an optimization parameter in quantum physics. To be more informative, the graph should display the values of these parameters above the bars. So far I did
\documentclass{minimal}
\usepackage[ngerman]{babel}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[title={$E_0$ über $n$}, ymax=2.5, yticklabels=]
\addplot [blue!90!white, fill=blue!50!white, ybar] coordinates {
( 1, 1.96556 )
( 2, 1.86105 )
( 3, 1.93185 )
( 4, 2.02568 )
( 5, 2.12077 )
( 6, 2.21219 )
};
\pgfplotsforeachungrouped \x/\y in {1/1.96556, 2/1.86105, 3/1.93185, 4/2.02568, 5/2.12077, 6/2.21219} {
\edef\temp{\noexpand\node[coordinate, pin={[rotate=90]0:\y}] at (axis cs:\x,\y) {};}\temp
}
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
This code outputs the following graph

Now I tried to add a little space between the bars and the pins, but I failed. I tried ++ (axis cs:0,0.1)
\edef\temp{\noexpand\node[coordinate, pin={[rotate=90]0:\y}] at (axis cs:\x,\y) ++ (axis cs:0,0.1) {};}\temp
and ++ (axis direction cs:0,0.1)
\edef\temp{\noexpand\node[coordinate, pin={[rotate=90]0:\y}] at (axis cs:\x,\y) ++ (axis direction cs:0,0.1) {};}\temp
Both variants give this error:
! Package tikz Error: A node must have a (possibly empty) label text.
I also tried pos=0.1
\edef\temp{\noexpand\node[coordinate, pin={[rotate=90]0:\y},pos=0.1] at (axis cs:\x,\y) {};}\temp
which compiles fine but gives this output

Thanks in advance, maeru.



\documentclassand the appropriate packages so that those trying to help don't have to recreate it. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Feb 4 at 21:38