# Makie 3d plot cannot rotate in jupyter notebook?

**URL:** https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191
**Category:** New to Julia
**Tags:** question, plotting, makie
**Created:** [September 15, 2021, 5:12am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191 "2021-09-15T05:12:35Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![jt\_Yang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jt_yang/32/29149_2.png) [@jt\_Yang](https://discourse.julialang.org/u/jt_Yang)
#### Post date: [September 15, 2021, 5:12am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/1 "2021-09-15T05:12:35Z")

</div>

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:

```julia
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

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [September 15, 2021, 6:44am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/2 "2021-09-15T06:44:12Z")

</div>

Not an expert but maybe try WGLMakie instead of GLMakie.

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

---

<div class="post-metadata">

### Author: ![HenrikM](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrikm/32/17975_2.png) [@HenrikM](https://discourse.julialang.org/u/HenrikM)
#### Post date: [October 27, 2021, 1:35pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/3 "2021-10-27T13:35:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)
#### Post date: [October 27, 2021, 2:43pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/4 "2021-10-27T14:43:11Z")

</div>

Try doing:

```julia
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.

---

<div class="post-metadata">

### Author: ![HenrikM](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrikm/32/17975_2.png) [@HenrikM](https://discourse.julialang.org/u/HenrikM)
#### Post date: [October 27, 2021, 6:35pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/5 "2021-10-27T18:35:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)
#### Post date: [October 28, 2021, 3:35pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/6 "2021-10-28T15:35:54Z")

</div>

Pinging @jules to see if he knows the answer.

---

<div class="post-metadata">

### Author: ![nchisholm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nchisholm/32/37414_2.png) [@nchisholm](https://discourse.julialang.org/u/nchisholm)
#### Post date: [November 2, 2021, 5:29pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/7 "2021-11-02T17:29:06Z")

</div>

For me, the following works.

First you need

> [@aramirezreyes](#):
>
> ```julia
> using GLMakie
> GLMakie.inline!(false)
> 
> ```

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.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [November 2, 2021, 6:17pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/8 "2021-11-02T18:17:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ZiyiLiu](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@ZiyiLiu](https://discourse.julialang.org/u/ZiyiLiu)
#### Post date: [June 30, 2022, 5:53am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/9 "2022-06-30T05:53:45Z")

</div>

Hi, I am new to julia, and I installed GLMakie in jupyter notebook, but I can’t run the code ‘using GLMakie’ because it will show error ‘invalid syntax’. How do you use the code ‘using GLMakie  
GLMakie.inline!(false)’ in jupyter notebook?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [June 30, 2022, 10:46am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/10 "2022-06-30T10:46:32Z")

</div>

What exactly did you run, the code you show is valid syntax (if written on two separate lines)

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 30, 2022, 10:56am UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/11 "2022-06-30T10:56:59Z")

</div>

I think they were trying to run `using GLMakie` in Python:

> [@How to use GLMakie in jupyter notebook?](https://discourse.julialang.org/t/how-to-use-glmakie-in-jupyter-notebook/83552):
>
> Hi, I am studying julia from yesterday, and I met a question when using GLMakie and python together in jupyter notebook. Then problem is that I can’t use ‘using Makie’ in my code. The error is in the picture below. Also, I want to rotate my 3D plot, however, the Makie is always ‘not responding’ after I use ‘display(fig1)’. Could you please help me with this? Thanks! Best, Ziyi

---

<div class="post-metadata">

### Author: ![ZiyiLiu](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@ZiyiLiu](https://discourse.julialang.org/u/ZiyiLiu)
#### Post date: [June 30, 2022, 5:35pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/12 "2022-06-30T17:35:01Z")

</div>

I want to use julia together with python, because most code for calculations is based on python. So, I import julia in python3 to plot 3D data based on the calculation results.  
Can I import julia and then use Makie to make 3D plot?

---

<div class="post-metadata">

### Author: ![ZiyiLiu](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@ZiyiLiu](https://discourse.julialang.org/u/ZiyiLiu)
#### Post date: [June 30, 2022, 5:40pm UTC](https://discourse.julialang.org/t/makie-3d-plot-cannot-rotate-in-jupyter-notebook/68191/13 "2022-06-30T17:40:59Z")

</div>

I am not sure whether I can also use python in the same time.
