I would like to put a confidence interval (error bars) in my bar graph, but I tried the += and -= and it did not work.
Here is the code:
\begin{tikzpicture}
\begin{axis}[
width = 0.50*\textwidth,
height = 8cm,
major x tick style = transparent,
ybar=2*\pgflinewidth,
bar width=25pt,
ymajorgrids = true,
symbolic x coords={A,B},
xtick = data,
scaled y ticks = false,
enlarge x limits=0.50,
ymin=0,
legend cell align=left,
legend style={at={(0.5,-0.12)},anchor=north}
]
\addplot[style={fill=white}]
coordinates {
(A, 2.98)
(B,4.23)};
\addplot[style={fill=black}]
coordinates {
(A,4.33)
(B,3.82)};
\legend{Red Graph, Blue Graph}
\end{axis}
\end{tikzpicture}
Best Answer
You have to enable the
error bars
using something likeas plot option.
Example: