# using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000].

What can I do to work around that problem? I am thinking of gnuplot, but I can't seem to get the syntax right. So, I wanted to plot the data, which is in a file, using gnuplot. I tried the following:

\addplot gnuplot [raw gnuplot,id=test,only marks]{plot 'date.dat' using 0:1};


In the pgfplot manual I could only find information about using gnuplot, when using functions, but not for cases when the data are already in an external file. I constructed a mwe down low, where you can see how I usualy plot my graphs. That works fine unless the datafile is a lot bigger than the one you'll see below.

Thanks a lot for your help.

\documentclass{scrbook}

\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\usepackage{tikz}
\usepackage{filecontents}

\begin{filecontents}{date.dat}
2012-01-01  1   3
2012-01-02  2   4
2012-01-03  2   5
\end{filecontents}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}
[
width=0.9\textwidth,
height=0.3\textheight,
date coordinates in=x,
unbounded coords=jump,
xtick={2012-01-01,2012-01-02,2012-01-03},
clip=false,
]
\addplot [only marks,mark size=1pt,red]table [x index=0,y index=1] {date.dat};
\addplot [only marks,mark size=1pt,green]table [x index=0,y index=2] {date.dat};
\end{axis}
\end{tikzpicture}
\end{figure}

\end{document}

• One simple solution could be to compile with lualatex. – alfC Apr 18 '14 at 6:57
• Take a look at tex.stackexchange.com/questions/71488/…. – Jake Apr 18 '14 at 8:53
• Well, I cannot restrict the data as proposed in the link @Jake posted. I found the right syntax however for the gnuplot command which is \addplot [red]gnuplot [raw gnuplot] {plot 'date.dat' using 2:3;}; However, that doesn't solve my problem, because when I plot my original data (which includes about 15.000 observations) I still get the error: TeX capacity exceeded, sorry [main memory size=3000000]. Thank you alfC for your suggestion, but I don't want to compile with lualatex, because I haven't set it up yet, and I don't want to mess with what's currently working. – neptunhiker Apr 18 '14 at 9:58
• How about this? – Pouya Apr 18 '14 at 10:15
• I just read that post as well and I tried Thomas F. Sturm's answer by adding --extra-mem-bot=100000000 to my comp. options. That didn't help though. I still get the same error, only that my memory size is now higher since I "added" the extra memory. – neptunhiker Apr 18 '14 at 10:29