Closed Holbormon closed 2 months ago
This seems to be a Plots.jl issue or?
Stacktrace points at PGFPlotsX/src/tikzdocument.jl, and the error has to do with the .tex generated figure. Unless Plots.jl is doing anything which messes with the code generated by the PGFPlotsX backend, this looks like a PGFPlotsX issue.
Could you provide an example without Plots.jl then that shows the bug in this package? Where does num edges nodes
come from?
Upon closer inspection of the TikzDocument
object wrapped by Plots.jl, it would seem that num edges nodes
is being added as an Option
to the TikzPicture
object by some upstream piece of code, as you correctly surmised earlier.
A surface guess would point at GraphRecipes.jl as being the introducer of this variable, but I don't have a good enough grasp of the whole ecosystem to tell which package down the GraphRecipes.jl => Plots.jl => PGFPlotsX.jl
chain should be responsible for stopping it from ending up in the final .tex code.
I'm fine with opening an issue under either or both of these other two packages but I could definitely use a hint regarding which one to target.
A fix was applied and merged upstream. Thank you for helping kickstart the discussion !
Consider the following MRE:
This yields the following
LuaLaTeX
error:Which in turn causes the following
Julia
stacktrace:I have managed to extract the generated temporary .tex file and did some debugging of my own. As it turns out, PGFPlotsX is generating a lot of the following tex command:
\addplot[color={rgb,1:red,0.0;green,0.0;blue,0.0}, name path={some-hex}, forget plot, draw opacity={1.0}, line width={1}, solid, num edges nodes={58}{10}]
in which
num edges nodes={}{}
is not recognized as valid key by PGF. Unfortunately, I do not have the required PGF/tikz knowledge to know whether it's because of a missing\usepackage
,\usepgfplotslibrary
,\usetikzlibrary
or because of a deeper bug.I have, however, noticed that for small graphs (producing < 100 errors), the temporary .tex file compiles just fine by using the
-interaction=nonstopmode
argument oflualatex
, as it ignores the errors and manages to produce a pdf regardless. I believe the 100 errors threshold is hardcoded in TeX.