# How to unstack grouped bars in pgfplots bar-charts

I am sure this is quite a trivial problem, but I cannot seem to figure it out. I have a bar-chart with preferably three groups of four bars. The thing is, using the MWE below, the four bars per group are all stacked together instead of nicely next to each other. I cannot find any significant changes from MWE's from similar questions which do seem to have what I want (i.e. Grouped bar charts).

MWE here:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={tree,indentation,parentheses},
ytick = {0,5000,10000,15000,20000,25000,30000,35000},
ymin = 0,
ymajorgrids = true,
ymax=35000,
scaled ticks= false,
ylabel = {Average response time(ms)},
xtick=data]
%Average
(tree,20962)
(indentation,24509)
(parentheses,33054)
};
%Organizational
(tree,22060)
(indentation,21255)
(parentheses,34917)
};
%Folder
(tree,17776)
(indentation,15050)
(parentheses,27904)
};
%Arithmetics
(tree,23599)
(indentation,22923)
(parentheses,17693)
};
\end{axis}

\end{tikzpicture}
\caption{Average response time for each representation type}
\label{fig:avg_reptime}
\end{figure}

\end{document}


Perhaps it is worth noting I'm working in compatibility version 1.13 (hence the \pgfplotsset{compat=1.13}.

In your case you need ybar as option in axis instead of \addplot.

Also you will need enlarge x limits to enlarge x axis.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={tree,indentation,parentheses},
ytick = {0,5000,10000,15000,20000,25000,30000,35000},
ymin = 0,
ymajorgrids = true,
ymax=35000,
ybar,
scaled ticks= false,
ylabel = {Average response time(ms)},
xtick=data,
enlarge x limits=0.2]
%Average
(tree,20962)
(indentation,24509)
(parentheses,33054)
};
%Organizational
(tree,22060)
(indentation,21255)
(parentheses,34917)
};
%Folder
(tree,17776)
(indentation,15050)
(parentheses,27904)
};
%Arithmetics
(tree,23599)
(indentation,22923)
(parentheses,17693)
};
\end{axis}

\end{tikzpicture}
\caption{Average response time for each representation type}
\label{fig:avg_reptime}
\end{figure}

\end{document}


Output