I need to plot a huge files like this one : https://www.dropbox.com/s/u63eu6497iogska/fichier.dat?dl=0 I wanted to use pgfplot in tikz but latex tell me there is not enought memory (even giving it more than usual).

How can I do ?

  • 2
    Gnuplot has no problem with the file, e.g.: echo "set datafile separator comma; plot 'fichier.dat' w l" | gnuplot --persist. – Thor Mar 1 '17 at 20:58
  • Ok. But I need to use it in LaTeX after, how can I do ? I want the same police, size and be able to adapt the size of the output for any file I do in latex with. Is this possible ? – zeslayer Mar 2 '17 at 23:32
  • 1
    Use one of the latex terminals, e.g. cairolatex: set term cairolatex; set output 'output.tex' – Thor Mar 3 '17 at 10:09
  • I tried it. I did a file with : set term cairolatex; set output 'output.tex'; set datafile separator ","; plot "fichier.dat"; And the .eps file is a 0ko file not working :'( – zeslayer Mar 5 '17 at 19:04
  • 1
    The output from this terminal is latex, so you need to do \input{output.tex} in the document and remember to \usepackage{graphicx} in the preamble. – Thor Mar 6 '17 at 7:45

You said, you wanted to use pgfplots/tikz. This also works.

The memory is not an issue if you compile it with LuaLaTeX.

But in this case I'd recommend to use an externalization. You'd also need (apart from the regular packages) \usetikzlibrary{external} \usepgfplotslibrary{external}

and should use a \tikzsetnextfilename{*NAME OF FIGURE*} before \begin{figure}

Then you only have to compile it when you changed something. This way the compilation time stays down. The size of the files will not really be an issue anymore with this approach. Because of the externalize you will need to compile with write18 or shell escape (depending what OS and TeX you use).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.