I try to add significance markers to my graphs that I made with pgfplots. In an answer to another question here I found the possibility to add \draw and \node into the code to draw a line with a asterisk above.
The code in the working example produces a figure that looks like the one in the first picture, but I would rather like to have something like the second picture (asterisk in the middle and small vertical lines that mark the end of the horicontal line).
Could somebody help me? Thank you!
\documentclass{apa6}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
enlargelimits=0.15,
height=0.7\textwidth,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ylabel={Pupillenweite},
symbolic x coords={Baseline,Stimulus},
xtick=data,
]
%neutral
\addplot[blue,fill=blue!30!white,error bars/.cd,y dir=both,y explicit,]
coordinates{(Baseline,0.0476) +-(0.02117,0.02117) (Stimulus,-0.1809) +-(0.01841,0.01841)};
%negativ
\addplot[red,fill=red!30!white,error bars/.cd,y dir=both,y explicit,]
coordinates{(Baseline,0.0342) +-(0.02073,0.02073) (Stimulus,0.1013) +-(0.01904,0.01904)};
\draw (axis cs:Baseline,0.1) ++ (-10pt,0pt) -- ++(280pt,0pt);
\node[anchor=south] at (axis cs:Baseline,0.1) {*};
\legend{neutral,emotional}
\end{axis}
\end{tikzpicture}
\end{document}



\pgfplotset{compat=1.13}in the preamble. And maybe you'll need some [ https://tex.stackexchange.com/questions/332553/problems-with-relative-axis-cs-coordinates-in-pgfplots ](axis direction cs:) somewhere. No time now, try to post another question! – Rmano Sep 26 '17 at 07:17