IJulia, WGLMakie, and JupyterLab: No output


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

n = Node(1)
ρl = lift(n) do n

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)

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.


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)
l = range(-10, stop = 10, length = N)
z = Float32[xy_data(x, y) for x in l, y in l]
    -1..1, -1..1, z,
    colormap = :Spectral