IJulia, WGLMakie, and JupyterLab: No output

Hello,

I am using IJulia and WGLMakie, and I’d like to make interactive plot. Unfortunately when I run this code in a cell, there is no output…

Nz = 100
Nt = 10
ρ_t = rand(Nz, Nt)

using Makie: Slider
using WGLMakie
WGLMakie.activate!()

n = Node(1)
ρl = lift(n) do n
    ρ_t[:,n]
end

fig = Figure(resolution = (1400, 800)) # 
ax = Axis(fig[1,1])
xlims!(ax, 0, Nz)
ylims!(ax, -1, 2)
lines!(ax, ρl; linewidth = 5)
sl = Makie.Slider(fig[2, 1], range = 1:Nt, startvalue = 1)
connect!(n, sl.value)
fig

But if I copy-past this code in an other notebook (with the same kernel) it works and I have an output. Then I copy-past this same code in an other notebook with the same kernel it does not work anymore…

I don’t understand. I use Windows and Google Chrome.

Thank you for your help.

3 Likes

In Jupiter with this code I have white page - only axes, scatter doesn’t works too. This code with wireframe works fine. Is it possible to make it work?

using WGLMakie
N = 60
function xy_data(x, y)
    r = sqrt(x^2 + y^2)
    r == 0.0 ? 1f0 : (sin(r)/r)
end
l = range(-10, stop = 10, length = N)
z = Float32[xy_data(x, y) for x in l, y in l]
surface(
    -1..1, -1..1, z,
    colormap = :Spectral
)