Save plot as .tex file

flobe
Thu, 11 Jan 2024 15:30:55 +0000
Visualization

Hi all,

I’m trying to export my plot in Julia as a pgf plot. So basically I want a .tex file with the data, the header, etc. automatically generated from the plot. However I’m not sure how to do it correctly. Currently I’m trying to use this MWE

using Plots
pgfplots()
Plots.plot(1:5)
Plots.plot!(1:5, (1:5).^2, tex_output_standalone = true)
savefig("myline.tex")

However I get the error:

ERROR: KeyError: key :label not found

Not sure what I’m doing wrong here …

Thanks for any advice

7 posts - 2 participants