0

I'm trying to plot a temperature map of certain shape. For fewer elements (less than 3000) I have no problem, but for too much elements (more than 250k) I can not produce the file. From these, I'd like that just about 125k coordinates be clickable. I get the error TeX capacity exceeded, sorry [token memory size=75830065]., and the process takes more than 10 minutes. I'm using LuaLaTeX.

Here is my current code

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{clickable,colormaps}
\pgfplotsset{
%colormap/hsv
colormap={hsv3}{
rgb255=(255,0,0)
rgb255=(127,255,0)
rgb255=(0,255,0)
rgb255=(0,127,255)
rgb255=(0,0,255)
rgb255=(127,0,255)
rgb255=(255,0,255)},
colormap name=hsv3,
annot/point format={(\%d,\%d)}
}
\standaloneenv{tikzpicture}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
    x=.15mm,y=.15mm,
    ymin=-0.5,ymax=250.5,
    xmin=-0.5,xmax=1000.5,
    colorbar,
    ticks=none
    ]
    \addplot[matrix plot, point meta=explicit,
    clickable coords={(xy): \thisrow{t}}
    ] table[x=x,y=y, meta=t]{temps001.dat};
    \end{axis}
\end{tikzpicture}
\end{document}

The temps001.dat has data of a 251x1001 matrix with about 50% of nan values. Here is part of my log

This is LuaTeX, Version 1.09.0 (MiKTeX 2.9.6880)  (format=lualatex 2018.11.17)  21 NOV 2018 01:55
 restricted system commands enabled.
...

(G:/TeX/MikTeX/texmfs/install/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count133
\scratchdimen=\dimen174
\scratchbox=\box41
\nofMPsegments=\count134
\nofMParguments=\count135
\everyMPshowfont=\toks40
\MPscratchCnt=\count136
\MPscratchDim=\dimen175
\MPnumerator=\count137
\makeMPintoPDFobject=\count138
\everyMPtoPDFconversion=\toks41
) (G:/TeX/MikTeX/texmfs/install/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

(G:/TeX/MikTeX/texmfs/install/tex/latex/oberdiek/grfext.sty
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)
)
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 43
8.
Package grfext Info: Graphics extension search list:
(grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG
,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 456.
)
ABD: EveryShipout initializing macros

Package pgfplots Warning: running in backwards compatibility mode (unsuitable ti
ck labels; missing features). Consider writing \pgfplotsset{compat=1.16} into yo
ur preamble.
 on input line 18.

\AtBeginShipoutBox=\box42
Package hyperref Info: Link coloring OFF on input line 18.
(G:/TeX/MikTeX/texmfs/install/tex/latex/hyperref/nameref.sty
Package: nameref 2016/05/21 v2.44 Cross-referencing by name of section

(G:/TeX/MikTeX/texmfs/install/tex/generic/oberdiek/gettitlestring.sty
Package: gettitlestring 2016/05/16 v1.5 Cleanup title references (HO)
)
\c@section@level=\count139
)
LaTeX Info: Redefining \ref on input line 18.
LaTeX Info: Redefining \pageref on input line 18.
LaTeX Info: Redefining \nameref on input line 18.

(./transcal001.out) (./transcal001.out)
\@outlinefile=\write5

\openout5 = transcal001.out
LaTeX Font Info:    Try loading font information for U+pzd on input line 18.

(G:/TeX/MikTeX/texmfs/install/tex/latex/psnfss/upzd.fd
File: upzd.fd 2001/06/04 font definitions for U/pzd.
){G:/TeX/MikTeX/texmfs/data/pdftex/config/pdftex.map} (./pgfplotsJS.djs
(G:/TeX/MikTeX/texmfs/install/tex/latex/acrotex/dljscc.def))
PGFPlots: reading {temps001.dat}

Runaway argument?
{ /U << /S/JavaScript/JS(axisMouseUp("clickableplot0", { axisType: "r\ETC.
! TeX capacity exceeded, sorry [token memory size=75830065].
<argument> ...xy): 109.71"],[1.4e1,6.0e0,"(xy): 109.92"]\ETC.

l.30    \end{axis}

If you really absolutely need more capacity,
you can ask a wizard to enlarge me.



Here is how much of LuaTeX's memory you used:
 28509 strings out of 494324
 8674235,75830065 words of node,token memory allocated 7127492 words of node memory still in use:
   9 hlist, 2 rule, 6 dir, 56 glue, 3 kern, 1 glyph, 1018096 attribute, 52 glue_
spec, 1018096 attribute_list, 5 temp, 9 if_stack, 1 write, 1018061 pdf_literal, 
3 pdf_refobj, 1 pdf_dest, 2 pdf_colorstack nodes
   avail lists: 1:3,2:3,4:3,5:9,6:1,9:8,11:1
 31804 multiletter control sequences out of 65536+200000
 17 fonts using 653099 bytes
 62i,6n,96p,746b,2421s stack positions out of 5000i,500n,10000p,200000b,500000s
!  ==> Fatal error occurred, no output PDF file produced!

My computer has 8GB of ram, windows 7, core2quad. I alredy tried editing the lualatex.ini opened by initexmf --edit-config-file=lualatex. It has:

main_memory=200000000000
pool_size=2000000000
save_size=2000000000
extra_mem_bot=2000000000
extra_mem_top=2000000000
font_mem_size=2000000000

A nice solution could be make only the not nan values (that are about 50% of all these coordinates) clickable. Is it possible? Also whould be nice to deactivate the snap to nearest feature. I just want to show the temperature anywhere in the shape.

EDIT1: I was using a computer with a g41 mother board and 4gb ddr2, the same processor, hd and OS, and some times, when the machine was doing nothing (but not necesseraly every time it was doing nothing), the code compiled. Now I got my computer back to my current config and doesn't run.

EDIT2: after edit the lualatex.ini and luatex.ini the code doesn't run at all, instantly returns the same error. after some tries it tries to compile again

4
  • 9
    Please do not get mad at me, but who is going to click on 250k coordinates? What I want to say is that it might be worthwhile to question first how many coordinates one may really want to click in a given plot before trying to make changes to the library.
    – user121799
    Nov 21, 2018 at 5:16
  • The idea is to show the temperature wherever the teacher would like to know. The shape is simulated as a grid that can become bigger accordingly to the requested precision, but doesn't use the whole rectangle, just about 50%. This feature is similar to the datatips at matlab. Nov 21, 2018 at 13:57
  • You note that you could remove NaNs. This suggests the need for foreach and/or if-else-endif functions. Alternatively, parse the data externally first to create two files, one with the NaNs removed and another with the (x,y) coordinates of the values that remain. Nov 21, 2018 at 15:02
  • Cannot plot imcomplete matrices with \addplot table{file}. Could you explain better what can be done? Nov 21, 2018 at 15:36

0

You must log in to answer this question.

Browse other questions tagged .