Closed pstaabp closed 4 years ago
I am not sure this is a bug in this package, rather than the relevant backend of Plots.jl.
Code using PGFPlotsX only would be helpful to establish this.
@BeastyBlacksmith, can you please try replicating this with Plots?
Thats due to the preamble, the following will work:
using Plots,PGFPlotsX
pgfplotsx()
heatmap(rand(10,10), tex_output_standalone = true)
savefig("heat.tex")
run(`lualatex heat.tex`)
However, if you want to use those .tex
-files in another document, you can query the preamble with Plots.pgfx_preamble
.
Yes, this seems like it works.
If I am embedding this in an existing document, do I need to add all of the packages that are included at the top? I'm guessing this is what you mean by the Plots.pgfx_preamble
?
Is this in the documentation somewhere?
I don't think this is an issue with PGFPlotsX, so I am closing. Perhaps the backend documentation of Plots.jl could mention the existence of pgfx_preamble
, please open another issue at
I added a section to the docs here
If I am embedding this in an existing document, do I need to add all of the packages that are included at the top?
Not neccessarily everything, since for example, if you don't do smithcharts you don't need to include that package. But if you include everything, it should work.
I appreciate the additional documentation. I tried the .tikz
approach and a couple of thing.
savefig
saves the file with extension .tikz.tex
, not .tikz
. Was this supposed to happen?\includegraphics
from graphicsx
it didn't take either .tikz
or .tex
files. I get a ! LaTeX Error: Unknown graphics extension: .tex.
. Is there a different package than graphicx
that includes this? open("preamble.tex", "w") do f
write(f, Plots.pgfx_preamble(pl3) )
end
and then in the preamble to the latex file, I needed to strip the second line which includes the standalone document class and then in the latex document include \input{preamble.tex}
in the preamble of the tex document. This may be helpful for some.
If you enter:
You get the expected output:
However, if it is saved using
upon compiling in latex, the following error occurs:
where the line 117 is the end of the
\addplot3
command. There are many many errors after that too.