I want to create some huge pgfplot with three different axis and a lot of data points. In summary there are 20160 lines of data existent.

My problem is: All few hours the values will change significantly for a time span of more or less one hour. Afterwards the values fall back to their previous levels. Therefore I cannot just reduce the amount of data without considering its variability.

Now I have tried different approaches on how to decrease LaTeX memory usage to avoid the capacity exceeded error:

  • Decrease plots point density with each nth point = {some high value} (see here)
  • Decrease plots point density with y filter = "plot only values if bigger than..." (see here)

None of them has worked fine.

Questions are:

  1. Does LaTeX care about it at all if I set some of the above mentioned options to the axis, or does it only care about the amount of data in the raw data table (without considering axis options)?

  2. Are there some other options available to avoid this "famous error" of exceeding the memory?

  3. Is externalizing the compilation process still actual?

Unfortunately, compiling with LuaLaTeX didn't succeed as well.

  • 1
    Have you tried using LuaLaTeX and (important) setting \pgfplotsset{compat=1.16} (which is the current version, the Lua backend will be used with 1.12 and up only, see the manual). – TeXnician Apr 20 at 21:59
  • 1
    All externalize does is move the pgfplot to a separate standalone document, so that ONLY the plot is processed. With really big datasets, even that isn't enough. The bear is dancing as hard as it can. – John Kormylo Apr 21 at 1:59
  • @TeXnician: Good point, thanks! On my older machine (Debian Stretch) I set it to 1.14. @JohnKormylo: Oh, okay! I thought even if creating a plot as standalone it could externalize the single axis to reduce the memory maybe? – Dave Apr 21 at 6:26
  • 1
    What externalize does is to compile a file in the background in a normal TeX process utilizing your full preamble. If you choose to make a standalone plot there is no benefit in using externalization. – TeXnician Apr 21 at 7:09
  • 2
    One could conceivably break the dataset into 2 or more blocks and process each block separately. Then one simply has to overlay the resulting images. – John Kormylo Apr 21 at 16:01

Your Answer

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

Browse other questions tagged or ask your own question.