I am trying to plot 12 different lines with a for loop and with a gradually changing color. I came up with this simple code:
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
ylabel={Normalized Intensity (a.u.)},
xlabel={Energy (eV)},
]
\foreach \column in {1,...,12}{
\addplot[style = solid, color = red!\column!black] table[x index = {0}, y index = {\column}] {../Data/12spectra.asc};
}
\end{axis}
\end{tikzpicture}
\caption{blablablabla}
\end{figure}
but the command red!\column!black does not work. I thought that the keyword \column would have been substituted at each occurrence with its value... The error I get is
!Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.75 \end{axis}
I have seen this question Changing color in foreach, but it didn't help me.
I have included only the pgfplots package, do I need another one?
Do you have any suggestion on how to fix the problem?