# Spacing in pgfplots bar plot

I've been trying to plot an xbar graph using pgfplots within a tikzpicture. I want to be able to only show the yaxis on the left and the x axis on the bottom. When I set axis y line=left and axis x line=bottom though, I get arrows on the axis. Is it possible to remove them? Also, I can't seem to control the spacing of the bar plots, is that possible? I'd like them to be much closer together then they are currently. Here's my attempt so far:

\begin{tikzpicture}
\begin{axis}[
xbar,
symbolic y coords={4 Sep 11,4 Oct 11,4 Nov 11},
width=0.4\textwidth,
height=0.15\textheight,
nodes near coords={\\pgfmathprintnumber\pgfplotspointmeta}, nodes near coords align={horizontal}, xtick=\empty, axis x line=bottom, axis y line=left, xmin=0, bar width=12pt, enlarge limits=0.2, ] \addplot[fill=blue] coordinates {(121.28,4 Nov 11) (100.00,4 Oct 11) (50.00,4 Sep 11)}; \end{axis} \end{tikzpicture}  The output of which is: Things I have tried: enlarge limits (If I enable it, the plot looks a bit nicer), xbar interval and shrinking the height of the plot to no avail. I'm a little stumped at the moment. - add comment ## 1 Answer Use the starred version of these options. Regarding the distance between the bars you should increase the height of the plot. \documentclass{minimal} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[% xbar, symbolic y coords={4 Sep 11,4 Oct 11,4 Nov 11}, width=0.4\textwidth, height=0.25\textheight, nodes near coords={\\pgfmathprintnumber\pgfplotspointmeta},
nodes near coords align={horizontal},
xtick=\empty,
axis x line*=bottom,
axis y line*=left,
xmin=0,
bar width=12pt,
enlargelimits=0.2,
]
\addplot[fill=blue] coordinates {(121.28,4 Nov 11) (100.00,4 Oct 11) (50.00,4 Sep 11)};
\end{axis}
\end{tikzpicture}
\end{document}


Details in the pgfplots manual

-
Oh boy, that was awesome -- everything's working! The starred versions got rid of the arrows. enlargelimits=0.2 caused the x limits to change also so I used enlarge y limits=0.2 and that did the job perfectly. As for the spacing, it seems to be much better. Thanks! –  slurms Nov 8 '11 at 16:17
@slurms: I would recommend you set enlarge x limits={upper, value=0.2}. That way, only the upper limit is moved, so the bars still start at the y axis. –  Jake Nov 8 '11 at 20:48