Here are my MWE:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\pgfplotstableread{
x y error
P53 0.21 0.07
IgG -0.16 0.06
cTnI 0.03 0.04
PSA -0.22 0.05
Myo -0.05 0.03
AFP -0.09 0.02
Serum 0.05 0.06
CKMB 0.89 0.01
}\datatable
\begin{tikzpicture}
\begin{axis}[
ybar,
bar width=14pt,
symbolic x coords={P53,IgG,cTnI,PSA,Myo,AFP,Serum,CKMB},
xlabel=xlabel,
ylabel=xlabel,
]
\addplot+ [
error bars/.cd,
y dir=both,
y explicit relative,
] table [y error=error] {\datatable};
%\addplot+ (P53,0) -- (CKMB,0);
\end{axis}
\end{tikzpicture}
\end{document}
And here is my expected result:
PS: Can you tell me what's wrong with the x-tick?
\addplot+ coordinates {(P53,0) (CKMB,0);}
or just\draw[red] (P53,0) -- (CKMB,0);
. – user231225 Dec 24 '20 at 16:02