Makie 3d plot cannot rotate in jupyter notebook?

Hi, I tried a Makie 3d plot sample both in REPL and jupyter notebook. REPL created a new Makie window for the plot and the plot can be rotated with mouse, however, jupyter only gave a fix pic which cannot be rotated at all.
I encountered Makie Pkg install error once, before I rm and build Makie, I got a turnable pic only once with errors, and now I rebuild all things, but all pic I got in jupyter is not turnable.
It’s that a bug or just some function not added yet?
my codes here:

using GLMakie

xs = LinRange(0, 10, 100)
ys = LinRange(0, 15, 100)
zs = [cos(x) * sin(y) for x in xs, y in ys]
fig, _ = surface(xs, ys, zs, axis=(type=Axis3,camera = cam3d!))
fig

jupyter: win10, jupyter-notebook : 6.0.3

Update: WGLMakie also tried, gives output cannot checked in jupyter cell, may some wrong setting caused the cell size didnot fit to the pic

1 Like

Not an expert but maybe try WGLMakie instead of GLMakie.

UPDATE: Didn’t work for me in a quick check.

This is a good questions that needs an answer. Does anybody know how to do it?

Try doing:

using GLMakie
GLMakie.inline!(false)

This will force GLMakie to open a separate, interactive window. With the inline result the plot will not be interactive.

Adding the Makie label to this to see if one of the devs sees it more easily and can confirm.

Did not work for me, the plot is still inline and static.

Pinging @jules to see if he knows the answer.

For me, the following works.

First you need

Then, make the last line of your notebook cell display(fig). For me, I get a Makie window which I can interact with. If instead the last line is just fig, then you get an inline, static plot.

Honestly, I cannot remember how I found this out, but it seems to give the desired result.

The reason is probably that the cell output isn’t created by calling display and capturing the output of that (which would trigger the glmakie window) but to try show methods with some mime types that the cell supports, like png, svg, etc. So without display(), you get a static image.

1 Like