# Pgfplot won't compile more than 6 curves on the same plot

I want to plot with pgfplots 12 curves on the same plot. The curves are given by 12 csv tables named "curve_01","curve_02" etc., about 3000 points each. To reduce computational time I reduce the number of points giving the "each nth point" option. I used also externalization with shell escape command.

Here my code:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\usepgfplotslibrary{external}
\tikzexternalize

\begin{document}

\begin{tikzpicture}
\begin{axis}[each nth point=1000, filter discard warning=false, unbounded coords=discard ,cycle list name=color list]
\foreach \x in {01,02,03,04,05,06,07,08,09,10,11,12}
\addplot table[col sep=comma, x index=2,y index=0] {../../Test_DCBII/curve_\x.txt};
\end{axis}

\end{tikzpicture}

\end{document}


The problem is that this code plots only 6 out of 12 curves needed, no matter if I reduce the points to calculate. How can I fix this??

The files can be found here (i uploaded just 9 files)

• could you post just one of the data files you're using, e.g Test_DCBII/curve_01.txt? – cmhughes Jun 24 '14 at 23:33
• I just edited the answer – user51020 Jun 25 '14 at 6:56
• Ahem if it's only a memory limit compile with lualatex. – s__C Jun 25 '14 at 7:13
• No it's not a problem relative to memory (I don't have any error mesages) the problem is that this code works only with the first six curves; the others won't plot even if I refresh multiple times. I can't figure out what's going wrong. – user51020 Jun 25 '14 at 7:15
• Won't the option each nth point=1000 make it skip ~1000 points in plot? Could it be that some data sets have less than 1000 points? Did you try removing that option? – alfC Jun 25 '14 at 7:41

## 1 Answer

I commented out line 7 (starting with "carico,tempo,...") from your original files and then the plot looks fine, with 9 curves, without externalizing the plots.

I'm working on Ubuntu 12.04 and compiled with TexWorks Version 0.5 r.952 (Debian).

\documentclass{article}

\usepackage{pgfplots}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}

\begin{document}
\begin{tikzpicture}
\begin{axis}[each nth point=1000, filter discard warning=false, unbounded coords=discard ,cycle list name=color list]
\foreach \x in {01,02,03,04,05,06,07,08,09}
\addplot table[col sep=comma, x index=2,y index=0] {curve_\x.txt};
\end{axis}
\end{tikzpicture}
\end{document}


• Nice, next time i will apply a better formatting method for my tables ;). Now I will try some modification, thank you. – user51020 Jun 25 '14 at 8:14