JuliaTeX / TikzPictures.jl

Creating PGF/TikZ pictures and saving them in various formats
Other
89 stars 28 forks source link

Error when saving an Image to .tex #43

Closed MaximeBouton closed 5 years ago

MaximeBouton commented 5 years ago

When saving a tikz picture that contains an image as a .tex file, the content of the .tex points to a temporary png file that is deleted.

I will try to provide a MWE to reproduce the error. @Shushman

MaximeBouton commented 5 years ago

This is a MWE using PGFPlots:

using PGFPlots
f = (x,y)->x*exp(-x^2-y^2)
p = Plots.Image(f, (-2,2), (-2,2))
save("testimage.tex", p)

on ubuntu, through a jupyter notebook.

mykelk commented 5 years ago

I think in https://github.com/JuliaTeX/PGFPlots.jl/blob/master/src/PGFPlots.jl lines 774 and 777 that have cleanup(o) should not be there.

@MaximeBouton can you verify and the commit the fix if so?

MaximeBouton commented 5 years ago

Commenting those lines indeed work! I will submit a PR to PGFPlots.