2

I have the following histogram:

\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Throughput,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ybar,
bar width=7pt,
height=5 cm,
width=8cm,
xtick={16,24,32,48},
bar width=9pt,
nodes near coords
]
\addplot
coordinates {(16,0.78329073) (24,0.850329257)
(32,0.884738383) (48,0.908459915)};
\addplot
coordinates {(16,0.798544555) (24,0.8936027498627455)
(32,0.964614686) (48,0.985576186)};
\legend{Node, Chrome}
\end{axis}
\label{fig:tp-histogram}
\end{tikzpicture}

As you can see the coordinates for the bars are 16, 24, 32 and 48. When drawing the histogram, pgfplots leaves a space in between 32 and 48 (at 40). Is it possible to collapse that and get 32 and 48 close like 16, 24 and 32 are?

Thanks

3
  • 3
    Instead of xtick you can use symbolic x coords={16,24,32,48}, – percusse Nov 10 '14 at 19:35
  • 1
    @percusse care to answer? – Paul Gessler Apr 25 '15 at 1:12
  • 4
    I'm voting to close this question as off-topic because it should be solved by percusse's comment. – Stefan Pinnow Oct 30 '16 at 20:11

Browse other questions tagged or ask your own question.