Am 14.11.25 um 12:11 schrieb Hans Hagen via ntg-context:
On 11/14/2025 10:29 AM, Henning Hraban Ramm wrote:
Hi, did anyone succeed in using pgfplots within a CLD document?
While context.starttikzpicture() … context.stoptikzpicture() seems to
work, everything inbetween is just output but not executed.
So I guess,
context.starttikzpicture()
context.startaxis{title="bla", xlabel="mm", ylabel="min"}
context.addplot(…)
context.stopaxis()
context.stoptikzpicture()
… is not the right way?
you have to get around catcode hell ... so best collect the picture in a
string and then flush is, like:
\startluacode
buffers.assign("crap",[[
\string\starttikzpicture
\string\startaxis[title=bla,xlabel=mm,ylabel=min]
\string\addplot{exp(x)};
\string\stopaxis
\string\stoptikzpicture
]])
context.getbuffer { "crap" }
\stopluacode
here we need \string but in pure cld likely not
next time come with a proper mwe ... now i had to waste time to figure
out that i had to load more than tikz (i'm not familiar with it so it's
trial and error for me)
Thank you!
Sorry, the code is on a different computer…
But the whole crap will become a meeting talk, hopefully an interesting
one ;)
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________