# Makie: animation becomes slow after redrawing surface about 25 times

**URL:** <https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582>\
**Category:** Performance\
**Created:** [August 26, 2020, 5:38pm UTC](https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582 "2020-08-26T17:38:03Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![samo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samo/32/35398_2.png) [@samo](https://discourse.julialang.org/u/samo)\
**Post date:** [August 28, 2020, 4:50pm UTC](https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582/7 "2020-08-28T16:50:19Z")

</div>

Thanks @jules! You got it 100%. I assumed

```julia
glacier = Makie.surface!(scene, X, Y, H_v)

```

would give back a handle for the surface, not for the scene. So, I applied your first suggestion with Observables and got

```julia
#(...) 
HB_v = fill(NaN, nx, ny)
HB_vn = Node(HB_v)
scene = Makie.surface(0:dx:lx, 0:dy:ly, transpose(B_v), colormap = cgrad(:terrain, scale=:exp10))
Makie.surface!(scene, X, Y, HB_vn, colormap=ice_color, shininess=Float32(2^10), transparency=true, shading=true)

record(scene, "glacierflow.gif"; framerate = 25) do io
    for it = 1:nt
        #(...) 
        HB_v .= transpose(B_v.+H_v)
        HB_vn[] = HB_v
        recordframe!(io)
        #(...) 
    end
end

```

This works, but now, I have still one little doubt: I am not familiar with the syntax `data[]`, i.e. what does that exactly do?

Then, here you see my first little thing done with Makie:

 ![glacierflow](https://global.discourse-cdn.com/julialang/original/3X/6/8/68acd2356593be9b7ab2565c76ec0ac4f13bf5ce.gif)

It’s very cartoon-like 🙂 What is not bad as it is a purely synthetic setup, but I would very much appreciate any ideas to improve it! The colors are certainly something to change…

Thanks!!

---

_[View the full topic](https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582)._
