I'm trying to draw a grouped bar plot, but with added dots "on top" to signify outliers in the results.
Currently I have:
\begin{figure}[]
\begin{tikzpicture}
\begin{axis}[
width = 1*\textwidth,
height = 4.5cm,
major x tick style = transparent,
ybar=1*\pgflinewidth,
bar width=13pt,
symbolic x coords={A,B,C,D},
xtick = data,
enlarge x limits=0.25,
ymax=15,
ymin=0,
legend cell align=left,
legend style={
at={(1,1.05)},
anchor=south east,
column sep=1ex
}
]
\addplot[style={fill=red,mark=none}]
coordinates {(A, 4.44) (B,0.1) (C,4.37) (D,4.07)};
\addplot[style={fill=green,mark=none}]
coordinates {(A, 0.4) (B,0.8) (C,0.3) (D,0.5)};
\addplot[style={fill=blue,mark=none}]
coordinates {(A, 0.2) (B,0) (C,0.9) (D,0.8)};
\addplot[style={fill=yellow,mark=none}]
coordinates {(A, 9.59) (B,0.2) (C,8.86) (D,8.62)};
\draw node[fill,circle,scale=0.5]{} (axis cs:A,7);
\draw node[fill,circle,scale=0.5]{} (axis cs:B,11);
\draw node[fill,circle,scale=0.5]{} (axis cs:C,3);
\draw node[fill,circle,scale=0.5]{} (axis cs:D,12);
\legend{C1,C2,C3,C4}
\end{axis}
\end{tikzpicture}
\end{figure}
This draws the grouped plots etc, but the "dots" always appear at the (0,0) position, ignoring the relative coordinates. See the picture below, where it is close to the "A". Ideally, I'd like to position such a dot above every bar in the graph. How can I properly specify the coordinates?
\node
syntax slightly wrong: It's\node [<options>] at (<coordinate>) {<text};
, then your circles will be positioned almost correctly. However, they will appear above the lettersA
,B
, etc., not above a particular bar. Do you want to be able to mark particular bars, or whole groups of bars?