I am trying to get labels over the bars in my bar chart.
I found \node [above] at (axis cs: 1, 810) {$Q1$};, but this one centers itself in the middle between two bars. I want the value from the y-axis to be floating over the top of the bar (or maybe inside it)
my MWE looks like this, its not very expressive without labels. any suggestions?
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
ybar,
width = 12cm,
height = 5cm,
bar width=20pt,
ylabel={number of participants},
symbolic x coords={High School, Bachelor degree, Master degree, Ph.D or similar},
xtick = data,
]
\addplot[fill=blue] coordinates {(High School, 1) (Bachelor degree, 2) (Master degree, 3) (Ph.D or similar, 4)};
\addplot[fill=red] coordinates {(High School, 3) (Bachelor degree, 2) (Master degree, 8) (Ph.D or similar, 4)};
\legend{Native speaker, Non-native speaker}
\end{axis}
\end{tikzpicture}
\caption{Participants: Level of education}
\label{participantsLanguageOverviewNonNative}
\end{figure}
\end{document}

nodes near coordsto theaxisoptions. – Torbjørn T. Mar 21 '14 at 21:11