I'm trying to change the appearance of a specific bar in a grouped barplot with TikZ. But I can't find anywhere how to do what I want to achieve.
Specifically, I have three groups of three bars, where the first one represents something completely different from the other two. I would like to make it appear like the following example that I've made in powerpoint:
Do you have any idea on how to realize this?
EDIT: This is what I've made so far:
\documentclass[10pt,bigtitle,twocolumn,SECTION,absheading]{article}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{pgfplots.groupplots}
\begin{document}
\begin{figure}[h]
\pgfplotsset{compat=1.14}
\pgfplotsset{
legend image with text/.style={
legend image code/.code={%
\node[anchor=center] at (0.3cm,0cm) {#1};
}
},
}
\begin{tikzpicture}
\begin{groupplot}[
group style={
group size=1 by 2,
x descriptions at=edge bottom,
y descriptions at=edge left,
vertical sep=1.6mm, % modified
group name=G % added
},
ybar,
axis lines=left, % added
enlarge y limits=0,
enlarge x limits=0.3,
ylabel={\# trials},
xtick=data,
symbolic x coords={gHHT,gATH,gCTR},
nodes near coords,
nodes near coords align={vertical},
every node near coord/.append style={rotate=90, anchor=west},
legend style={at={(0.93,0.9)}},
]
\nextgroupplot[ymin=0, ymax=50, height=6cm, width=8cm]
\addplot coordinates {(gHHT,13.67) (gATH,7) (gCTR,13.5)};
\addplot coordinates {(gHHT,4.67) (gATH,33.6) (gCTR,38)};
\nextgroupplot[ymin=0, ymax=23, height=6cm, width=8cm]
\addplot coordinates {(gHHT,16.4) (gATH,12.3) (gCTR,0)};
\addplot coordinates {(gHHT,7) (gATH,6) (gCTR,0)};
\legend{\# valid,\# failed} % added
\addlegendimage{legend image with text=($\cdot$) \; \,}
\addlegendentry{\# part.}
\end{groupplot}
\node [rotate=90] at (G c1r1.east) {\textit{Manual control}}; % added
\node [rotate=90] at (G c1r2.east) {\textit{Shared control}}; % added
\node at (1.2,2.4) {(3)};
\node at (3.2,4) {(3)};
\node at (5.2,4.25) {(4)};
\node at (1.2,-0.4) {(5)};
\node at (3.2,-01.2) {(3)};
\node at (5.2,-3.8) {(0)};
\draw (current bounding box.south west) rectangle (current bounding box.north east); % added
\end{tikzpicture}
\caption{caption.}
\end{figure}
\end{document}


bar cycle listcan specify many things, but I suspect they are all boxes. You might try creating an invisible bar (opacity=0), saving the coordinates and drawing an overlay. – John Kormylo Mar 08 '17 at 02:01