I have the following xbar plot. I have two problems:
1) to see all the bars I have to do "enlarge y limits = X", where X is found by trial and error. This seems to result in the bars not being positioned correctly in relation to the values on the y axis. What is going on?
2) I want to label the bars and have set "nodes nears coords align=horizontal" as suggested in the manual and in this question but it doesn't seem to work. Any ideas why?
%% LyX 2.0.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{pgfplots}
\makeatother
\usepackage{babel}
\begin{document}
\begin{tikzpicture}[]
\begin{axis}[xbar,
width=10cm,
height=8cm,
enlarge y limits=0.5,
bar width=7pt,
nodes near coords,
nodes near coords align=horizontal,
point meta=explicit symbolic,]
\addplot+ coordinates {(1,1) [label1]};
\addplot+ coordinates {(3,2) [label2]};
\addplot+ coordinates {(5,3) [label3]};
\addplot+ coordinates {(6,4) [label4]};
\addplot+ coordinates {(4,5) [label5]};
\addplot+ coordinates {(16,6) [label6]};
\addplot+ coordinates {(6,7) [label7]};
\end{axis}
\end{tikzpicture}
\end{document}



upper. You saved me a lot of time. – Sigur Sep 10 '16 at 16:10