Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGFPlots.Image cleanup before display when using Interact #114

Open
kjulian3 opened this issue Apr 29, 2019 · 1 comment
Open

PGFPlots.Image cleanup before display when using Interact #114

kjulian3 opened this issue Apr 29, 2019 · 1 comment

Comments

@kjulian3
Copy link
Contributor

On a Windows machine I’ve installed a fresh Jupyter with Julia 1.1 along with the most recent versions of Interact (v0.10.2) and PGFPlots (v3.0.3). I’m having trouble using the @manipulate macro to manipulate a PGFPlots.Image. The PNG file that gets created seems to be deleted before being shown, resulting in the following error:

! Package luatex.def Error: File `tmp_10000000000001.png' not found: using draft 

setting. See the luatex.def package documentation for explanation. 

Type H <return> for immediate help. ... l.14 \end{axis}

If I plot without @manipulate, everything works just fine. Running @manipulate around other functions (such as PGFPlots.plot) also works just fine. The problem seems to be specifically using @manipulate around a PGFPlots.Image function. Here is a minimal working example:

using Interact
using PGFPlots

function testPlot()
    @manipulate for i = [1, 2, 3]
        f = (x,y)->x*exp(-x^2-y^2)
        g=PGFPlots.Image(f, (-i,i), (-i,i), colormap = ColorMaps.GrayMap(invert = true))
    end
end
testPlot()
@kjulian3
Copy link
Contributor Author

kjulian3 commented May 1, 2019

It seems that when using PGFPlots.Image with Interact, Base.show() gets called twice (Can be seen by adding a print statement to Base.show and setting cleanup(p::Image) = nothing on line 742). Since Base.show deletes the png file during the first call, the second call gives an error that the file is missing. If PGFPlots.Image is called without Interact, Base.show is only called once and everything works correctly.

Any ideas to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant