I can't find an answer online, please help me. The following plot shows the percentage of 3 groups. The red line is the average (and needs to stay at 13.8).
How can I move ONLY the node "2.9" a little bit up? (here it is not really problematic, but I have other graphs where the number and the red line are overlapping - looks terrible!)....
Thank you very very much!
\documentclass[pdftex,11pt,a4paper]{scrreprt}
\usepackage{geometry}
\geometry{a4paper,left=28mm,right=28mm, top=25mm, bottom=25mm}
\usepackage{acronym}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath,amssymb,amstext}
\usepackage{graphicx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\pgfplotsset{every axis/.append style={
font=\footnotesize,
line width=0.5pt,
bar width=7pt,
tick style={line width=0.4pt}}}
\begin{figure}[h!]
\begin{tikzpicture}
\begin{axis}[
xlabel=Test,
ymin=0, ymax=100,
ylabel=percentage,
enlargelimits=0.15,
ybar,
symbolic x coords={1,2,3},
xtick=data,
width=12cm,
bar width=10pt];
\addplot [black, fill=black,nodes near coords]
coordinates {(1, 55.6) (2,18) (3,2.9)};
\addplot[red,mark=none, sharp plot, line width=0.6pt]
coordinates {(1,13.8) (3,13.8)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
\documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[ybar,xtick=data]; \addplot[nodes near coords] coordinates {(1, 10) (2, 5)}; \end{axis} \end{tikzpicture} \end{document}
With this MWE, you could ask a more general question: How to adjust the position of the label node on a single bar?