Am 16.02.2014 21:39, schrieb Lukáš Procházka:
\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) .. "};")
this line would be enough with \ctxlua{...} Herbert
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
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________