Based on the code provided by Jake:
\draw[very thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);
I am drawing a zero line for y-values for bar plots. Yet it does not work if one uses symbolic x coords=....
One could write \draw[very thin] (axis cs:Fx,0) -- (axis cs:Fz,0);, but this does not suffice. Using Fx.west or Fx.left does not work.
MWE
\documentclass[
a4paper
]{scrartcl}
\usepackage{
amsmath,
tikz,
pgfplots,
pgfplotstable
}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{filecontents}{force-stats.txt}
Stats,Min,MinStdDev,MinCIP95,Max,MaxStdDev,MaxCIP95
Fx,-70.35,0.5,0.6,60,1,0.5
Fy,-40,0.5,0.6,50,1.91,1.5
Fz,-20,0.42,0.6,40,4,0.5
\end{filecontents}
\pgfplotstableread[col sep=comma]{force-stats.txt}{\tableabcdef}
\begin{document}
\begin{center}
\begin{tikzpicture}[font=\small]
\begin{axis}[
scale only axis=true,
width=5cm,
height=7cm,
%
xlabel={Force components},
ylabel={Force in N},
%
ybar,
%
xmajorgrids=true,
ymajorgrids=true,
%
enlarge x limits={0.3},
enlarge y limits={0.2},
%
symbolic x coords={Fx,Fy,Fz},
%
xtick=data,
nodes near coords,
xticklabels={{\(F_{x}\)},{\(F_{y}\)},{\(F_{z}\)}},
]
%the following line will not work
%\draw[very thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);
\addplot+[nodes near coords align={above}] plot [error bars/.cd, y dir=both, y explicit] table [col sep=comma, x=Stats, y=Max, y error=MinCIP95] {\tableabcdef};
\addplot+[nodes near coords align={below}] plot [error bars/.cd, y dir=both, y explicit] table [col sep=comma, x=Stats, y=Min, y error=MinCIP95] {\tableabcdef};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}


rel axis cscan work in this case (at least in this specific case where "y=0" can easily be translated to "0.5" in relative coordinates). – T. Verron Jul 18 '14 at 08:35\draw[very thin,red] ({rel axis cs:0,0} |- {axis cs:Fx,0}) -- ({axis cs:Fz,0} -| {rel axis cs:1,0});that works for me (the zeros specifying the y coordinate of your line being the ones inFx,0andFz,0). – T. Verron Jul 18 '14 at 08:53