Hello Herbert, On Sun, 16 Feb 2014 20:32:11 +0100, Herbert Voss wrote: > As far as I know \addplot scans the coordinates in a way that a > macro is not possible here . However, write your coodinates into an > external file and read it with I was aware of this solution; however, I was looking for another way due to performance reason and to avoid having too many temporary (data) files. > > \addplot table {}; > > That will work. It seems I found a more Lua way: ---- \usemodule[pgfplots] \startluacode data = {{5, 15}, {20, 20}, {24, -24}} data2crds = function(data) local str for i, v in ipairs(data) do str = (str or "") .. "(" .. v[1] .. "," .. v[2] .. ")" end print("Crds=", str) return str end -- plot = function(data) context.starttikzpicture() context.startaxis{} context.addplot{mark="none",color="red"} context("coordinates {" .. data2crds(data) .. "};") context.stopaxis() context.stoptikzpicture() end \stopluacode \starttext \starttikzpicture \startaxis[] \addplot[mark=none,color=red] coordinates {(11, 5) (12, 18)}; \stopaxis \stoptikzpicture \ctxlua{plot(data)} \stoptext ---- Anyway, thanks. Best regards, Lukas > > Herbert -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 Fax: +420 244 461 038