I am trying to draw a group tikz barchart (2 groups, 4 bars each) in Latex. I looked at all the questions and answers here but couldn't find a similar problem. My problem is that the graph output has 6 groups instead of 2. The graph should have 2 groups D1 and D2 and 4 bars in each group 1K, 1M, 10M and 100M
Here is my code:
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Time in Milliseconds,
symbolic x coords={D1,D2},
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1,draw=none},
ybar,
bar width=7pt,
]
\addplot[fill=blue!70!gray,draw=none] coordinates {(D1,0.589) (D2,8.4)};
\addplot[fill=gray!80!white,draw=none] coordinates {(D1,0.584) (D2,8.229)};
\addplot[fill=green!30!gray,draw=none] coordinates {(D1,0.599) (D2,8.109)};
\addplot[fill=blue!30!gray,draw=none] coordinates {(D1,0.615) (D2,9.13)};
\legend{1K,1M,10M,100M}
\end{axis}
\end{tikzpicture}
\caption{Time comparison}
\label{fig:readdsplot}
\end{figure}
Thanks in advance.