I was trying to make my error bars the same color as I have for my data on pgf-plot. The method was greatly explained earlier here - Define error bar color in scatter class
My code at the beginning
\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel={time, $s$},
ylabel={fraction},
ymin=0, ymax=1,
grid=major,
legend entries={$16nt$,$40nt$,$62nt$},
]
\addplot[
scatter,
only marks,
scatter src=explicit symbolic,
scatter/classes={
16nt={mark=square*,blue},
40nt={mark=triangle*,red},
62nt={mark=*,draw=black}
},
error bars/.cd,
y dir=both,
y explicit
]
table[x=x, y=y,y error = err, meta=label, row sep=crcr] {
x y err label\\
0.1 0.15 0.1 16nt\\
0.45 0.27 0.1 16nt\\
0.02 0.17 0.1 16nt\\
0.06 0.1 0.1 16nt\\
0.9 0.5 0.1 40nt\\
0.5 0.3 0.1 40nt\\
0.85 0.52 0.1 40nt\\
0.12 0.05 0.1 40nt\\
0.73 0.45 0.1 62nt\\
0.53 0.25 0.1 62nt\\
0.76 0.5 0.1 62nt\\
0.55 0.32 0.1 62nt\\
};
\end{axis}
\end{tikzpicture}
\caption{trial plot}
\end{figure}
But when I change
error bars/.cd,
y dir=both,
y explicit` by `error bars with color=err
as it was stated in the mentioned answer and add
error bars with color/.style={
visualization depends on=\thisrow{#1} \as \error,
visualization depends on=y \as \y,
scatter/@pre marker code/.append code={ % Homebrew color bars
\draw (0,0) -- +(axis direction cs:0,-\error) -- +(axis direction cs:0,\error);
\draw (0,0) plot [mark=-] coordinates {(axis direction cs:0,\error) (axis direction cs:0,-\error)};
},
error bars/.cd, % Invisible color bars, to get the right axis limits
y dir=both,
y explicit,
error bar style={opacity=0},
/pgfplots/.cd
}
I can't compile my document because it shows the mistake in line with \end{axis}
with message
TeX capacity exceeded, sorry[grouping levels=255].\pgfmth@float@parse#1->\begingroup\pgfkeys{/pgf/fpu/pgf/fpu/output form... \end{axis}
What does it mean? Sorry if question is stupid, I am new at LaTex and really stacked on this!