# Layout of bar charts in Latex

I created a bar chart, but it does not look good:

Problems:

1. the values above the bars does not look good. I want to have it on top of the bars and with slightly smaller font size;
2. The lay-out looks very cramped. I want to control the font size of the bar charts if possible;
3. I want to have a larger spacing between each groups, i.e., more spacing between 1 and 2, 2 and 3 etc;
4. I want to have the legend (Measured & Model) on top of each other, rather than side by side;
5. Group 9 does not appear on the bar chart, but I have it in my code;
6. I do not want spacing between the bars (i.e. no spacing between blue and red).

This is what I used:

    \usepackage{pgfplots}
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=$H_{m0}$,
xlabel= {Position},
enlargelimits=0.05,
legend style={at={(0,1)},
anchor=north,legend columns=-1},
nodes near coords,
every node near coord/.append style={font=\tiny},
nodes near coords align={vertical},
ybar interval=0.8,
]
coordinates {(01,0.150) (02,0.166)
(03,0.174) (04,0.186) (05,0.187) (06,0.152) (07,0.218) (08,0.187) (09,0.156)};
coordinates {(01,0.153) (02,0.162)
(03,0.178) (04,0.177) (05,0.222) (06,0.233) (07,0.323) (08,0.301) (09,0.233)};
\legend{Measured, Model}
\end{axis}
\end{tikzpicture}


Use ybar=0pt instead ybar interval. Adjust the width of the bars to your needs. Set width and height for the axis environment. Remove legend columns=-1.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
x tick label style={/pgf/number format/1000 sep=},
ylabel=$H_{m0}$,
xlabel= {Position},
%enlargelimits=0.05,% <- commented, default is .1
legend style={
at={(0,1)},
anchor=north west,% <- changed
%legend columns=-1% <- commented
},
nodes near coords,
every node near coord/.append style={font=\tiny},
%nodes near coords align={vertical},% <- commented, default
ybar=0pt,%<- changed