How to make a rotatable 3D plot in Jupyter?
For example, from the REPL, this works by opening a new tab in my browser:
using WGLMakie
let x = LinRange(-1,1,31), f(x,y) = x^2 - y^2
surface(x,x,f.(x,x'))
end
In the tab, there is a beautiful rotatable 3d picture. However, evaluating the same in a Jupyter cell only fires up the CPU for a couple of minutes and produces nothing. I tried the example at How to use JSServe + WGLMakie. In a Jupyter cell:
using JSServe
Page(exportable=true, offline=true)
using WGLMakie
let x = LinRange(-1,1,31), f(x,y) = x^2 - y^2
surface(x,x,f.(x,x'))
end
Again, the CPU works hard for a while and nothing is produced.
This is essentially the same question as Makie 3d plot cannot rotate in jupyter notebook?, but I did not want to highjack that thread.
It does not have to be Makie, any other plotting library is fine. For everyday work, I use Plots.jl, but rotatable 3D plots is the one feature I am really missing.