I have multiple machines on which I did benchmarks. Now I wan to use pgfplots to show multiple y values (the variance in the measurement) for a single x value (a benchmark parameter) within a single graph. Each machine should get its own "column" in the plot, similar to the effect ybar produces with multiple addplot commands.
In other questions I already found valuable hints but the legend is broken by the manual mark offset (xshift) as it is applied there as well.
Here's a MWE:
\documentclass[border=1mm]{standalone}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread{
A B C
foo 1 2.4
foo 1 2.1
foo 1 2.6
foo 1 2.3
}\dataA
\pgfplotstableread{
A B C
bar 1 2.9
bar 1 2.2
bar 1 2.5
bar 1 2.1
}\dataB
\begin{tikzpicture}
\begin{axis}[only marks, ybar, symbolic x coords={1}, xtick={1}]
\foreach \id / \offs / \tab in {foo/-4/\noexpand\dataA, bar/4/\noexpand\dataB} {
\edef\temp{\noexpand\addplot+ [every mark/.append style={xshift=\offs pt}] table[x=B, y=C] {\tab};
\noexpand\addlegendentry{\id}
}
\temp
}
\end{axis}
\end{tikzpicture}
\end{document}

I already tried to compensate for the xoffset by adding [every mark/.append style={xshift=-\offs pt}] to the addlegendentry command, but without any effect.
How can I get the desired "column effect" in the plot without messing up the legend?

legend style={every mark/.append style={xshift=+0pt}}seems to disable the shifting … – Qrrbrbirlbel May 09 '13 at 13:18axisit disables the shifting for the plotted points as well. I have no idea why it does this as the style should only be applied to the legend... – TableKing May 09 '13 at 13:51legend style={legend image post style={/tikz/xshift/.style=}}which simply disables thexshiftkey for the legend images. – Qrrbrbirlbel May 09 '13 at 14:19legend image post style={xshift/.style=}does the same job for me. – TableKing May 09 '13 at 14:47