# Makie volume animation froze!

**URL:** <https://discourse.julialang.org/t/makie-volume-animation-froze/43707>\
**Category:** New to Julia\
**Tags:** plotting, makie, animations\
**Created:** [July 26, 2020, 11:20am UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707 "2020-07-26T11:20:58Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Post date:** [August 3, 2020, 6:16pm UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/21 "2020-08-03T18:16:49Z")

</div>

Cool!

```julia
colors = to_colormap(:balance)
n = length(colors)
alpha = [ones(n÷3);zeros(n-2*(n÷3));ones(n÷3)]
cmap_alpha = RGBAf0.(colors, alpha)
scene1 = volume(a,algorithm=:absorption,colorrange=(-3,3),colormap=cmap_alpha)
scene2 = volume(a,algorithm=:mip,colorrange=(-3,3),colormap=cmap_alpha)

```

 ![abs_alpha](https://global.discourse-cdn.com/julialang/original/3X/6/1/61212cfccc2f83ec4d6da933f214ed560d5f46b5.jpeg)  
 ![mip_alpha](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe776ac0972a2f0ff98e514b68c2ccaa29633e0e.jpeg)  
That’s much improved, but `:absorption` is still muted (the colors are washing together?) and `:mip` still only catches the high range. Is colorrange the wrong parameter for this?

Contours look like this:

```julia
scene3 = contour(a.σ,levels=[-3,3],colormap=:balance)

```

 ![contour](https://global.discourse-cdn.com/julialang/original/3X/d/d/dd850439a0d2c33ceefcd806fac04837fcbbce05.jpeg)

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [August 3, 2020, 7:09pm UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/22 "2020-08-03T19:09:02Z")

</div>

> That’s much improved, but `:absorption` is still muted (the colors are washing together?) and `:mip` still only catches the high range. Is colorrange the wrong parameter for this?

Not sure, this is all not super well tested and used, so quirks are to be expected. I’m not 100% sure what you’re to achieve, so could be either a bug, or just still not the right parameters!

> Contours look like this:

Cool! Btw, to make it look more like absorption, you should be able to set e.g `alpha=0.5`

---

<div class="post-metadata">

**Author:** ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Post date:** [August 3, 2020, 7:31pm UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/23 "2020-08-03T19:31:09Z")

</div>

I’m trying to achieve something like the banner image - I want the vortex structures to be as bright and well defined as possible since they encode a bunch of information about the flow. (And they are pretty.)

Adding `alpha=0.2` is nice, but it seems to wipe out the contours near the torus. Maybe because those surfaces have less texture than the contours in the wake?

```julia
contour(a.σ,levels=[-6,6],colormap=:balance,alpha=0.2,colorrange=[-7,7])

```

 ![contour_alpha](https://global.discourse-cdn.com/julialang/original/3X/6/d/6d086089a4f034fefec0ad00834c26a31524b332.png)

---

<div class="post-metadata">

**Author:** ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Post date:** [March 17, 2021, 8:47pm UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/24 "2021-03-17T20:47:22Z")

</div>

I’m trying to update the Makie examples in WaterLily.jl, and I’m not sure how to get the 3C camera moves to work with the new `Figure` and `LScene` stuff.

For example, how can I zoom in on the example in the `volume` documentation.

```julia
r = LinRange(-1, 1, 100)
cube = [(x.^2 + y.^2 + z.^2) for x = r, y = r, z = r]
cube_with_holes = cube .* (cube .> 1.4)
fig,scene,_=volume(cube_with_holes, algorithm = :iso, isorange = 0.05, isovalue = 1.7)
zoom!(scene,zeros(3),1,true)

ERROR: MethodError: no method matching cameracontrols(::LScene)
Closest candidates are:
  cameracontrols(::Scene) at C:\Users\admin\.julia\packages\AbstractPlotting\ek9LT\src\scenes.jl:415

```

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [April 25, 2023, 12:10am UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/25 "2023-04-25T00:10:39Z")

</div>

Try

```julia
fig, lscene, _ = ...
scene = lscene.scene

```

and continue from there!

---

<div class="post-metadata">

**Author:** ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Post date:** [April 25, 2023, 11:27am UTC](https://discourse.julialang.org/t/makie-volume-animation-froze/43707/26 "2023-04-25T11:27:00Z")

</div>

Thanks, but I ended up removing it. (This post is two years old.)

[Previous page](https://discourse.julialang.org/t/makie-volume-animation-froze/43707.md?page=1)
