I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like:

The ybar stacked option works quite nice here. But when I try to adapt it to a groupplot I run into some problems. The goal is to create three groups with a xlabel each. In each group each bar should also have its own xticklabel. The MWE so far gives this

Why is there a seperation after the first three stacked parts? And how can I label the bars separately but also label the groups?
Is the groupplot command even the right one to approach to this "problem"?
MWE:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{pgfplots.groupplots}
\pgfplotsset{width=0.3\textwidth,compat=newest}
\pgfplotstableread{
cr Fii Faa Foo
abc 10 20 30
def 5 5 5
ghi 7 7 7
jkl 1.5 1.5 2.5
mno 2 2 2
pqrs 0 0 8
tuv 0 0 1.16
wxyz 0 5 0
}\first
\pgfplotstableread{
cr Fii Faa Foo
abc 7 7 12.9
def 7.5 7.5 7.5
ghi 8 8 8
jkl 1.5 1.5 2.25
mno 2 2 2
pqrs 0 0 8
tuv 0 0 1.544
wxyz 0 6.3 0
}\second
\pgfplotstableread{
cr Fii Faa Foo
abc 7 7 19
def 7.5 7.5 7.5
ghi 9 9 9
jkl 1.5 1.5 2.25
mno 2 2 2
pqrs 0 0 8
tuv 0 0 23
wxyz 0 8.4 0
}\third
\pgfplotsset{
select row/.style={
x filter/.code={\ifnum\coordindex=#1\else\def\pgfmathresult{}\fi}
}
}
\begin{document}
\begin{figure}[hbt!]
\centering
\begin{tikzpicture}
\begin{groupplot}
[
group style=
{columns=3,
ylabels at=edge left,
group name=plots},
ybar stacked,
scale only axis,
ylabel=y-axis,
ymin=0,
ymax=150,
height=0.5\textwidth,
xtick=\empty,
legend columns=-1,
legend image code/.code={%
\draw[#1] (0cm,-0.1cm) rectangle (0.3cm,0.1cm);
}
]
\nextgroupplot[xlabel=Item 1, legend to name=grouplegend,]
\pgfplotsinvokeforeach {0,...,7}{
\addplot table [x expr=\coordindex, select row=#1, y=Fii] {\first};
\addplot table [x expr=\coordindex, select row=#1, y=Faa] {\first};
\addplot table [x expr=\coordindex, select row=#1, y=Foo] {\first};
\addlegendentry {\pgfplotstablegetelem{#1}{cr}\of \first \pgfplotsretval}
}
\nextgroupplot[xlabel=Item 2]
\pgfplotsinvokeforeach {0,...,7}{
\addplot table [x expr=\coordindex, select row=#1, y=Fii] {\second};
\addplot table [x expr=\coordindex, select row=#1, y=Faa] {\second};
\addplot table [x expr=\coordindex, select row=#1, y=Foo] {\second};
}
\nextgroupplot[xlabel=Item 3]
\pgfplotsinvokeforeach {0,...,7}{
\addplot table [x expr=\coordindex, select row=#1, y=Fii] {\third};
\addplot table [x expr=\coordindex, select row=#1, y=Faa] {\third};
\addplot table [x expr=\coordindex, select row=#1, y=Foo] {\third};
}
\end{groupplot}
\node at (plots c2r1.north) [inner sep=0pt,anchor=south,yshift=3ex] {\ref{grouplegend}};
\end{tikzpicture}
\end{figure}
\end{document}

groupplotsto reproduce it, neither does the packagegermaninterfere with your problem. Also narrow it down to 1 table, you dont need 3. Sorry if it sounds harsh. But this will help you in the long run.Also try to transpose your data. That should make it easier to parse instead of
select row. – nickpapior Dec 15 '11 at 14:12deleteoption under the question. – percusse Dec 15 '11 at 15:03With my solution you can put the three next to each other and it will look just like the Excel plot. Which was your question (or so it seemed).
– nickpapior Dec 15 '11 at 16:37groupplotcommand. Sorry but there are commands I didn't even know they where existing. – Lorzen Dec 15 '11 at 17:00