I have four text files with each 21 columns, and I want to plot, for each file, the first column as x, and then the 20 next columns as y. For each file, then put it all together on the same graph. It's basically 20 replicates under 4 different conditions.
I have the following code, using \foreach, but I'd like to make it cleaner by using \addplot+ rather than \addplot with the fill argument. If I use \addplot+ within the \foreach loop, then each replicate has it's own color, and it's not really what I want.
To be clear, the following code does what I want, but I'd like to hear about solutions to make it nicer.
\documentclass[professionalfonts,11pt]{beamer}
\begin{document}
\begin{frame}{Conséquences des variations du taux de croissance}
\begin{center}
\begin{tikzpicture}
\begin{semilogyaxis}[
xlabel=Temps,
ylabel={Taille de population},
cycle list name = monokai,
legend pos = north west
]
\foreach \yindex in {2,...,20}
\addplot[mark = none, draw = RYB1] table [y index = \yindex] {data/vardem_30.dat};
\foreach \yindex in {2,...,20}
\addplot[mark = none, draw = RYB2] table [y index = \yindex] {data/vardem_10.dat};
\foreach \yindex in {2,...,20}
\addplot[mark = none, draw = RYB3] table [y index = \yindex] {data/vardem_3.dat};
\foreach \yindex in {2,...,20}
\addplot[mark = none, draw = RYB4] table [y index = \yindex] {data/vardem_1.dat};
\end{semilogyaxis}
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
\addplotcommands under one\foreach. Is that what you mean by niceness? You can find the explanation for using+in the manual. – percusse Aug 26 '12 at 10:11