# Julia GLMakie plotting "contour" animation, old frames stay

**URL:** <https://discourse.julialang.org/t/julia-glmakie-plotting-contour-animation-old-frames-stay/85283>\
**Category:** Visualization\
**Tags:** plotting, glmakie, animations\
**Created:** [August 4, 2022, 7:25am UTC](https://discourse.julialang.org/t/julia-glmakie-plotting-contour-animation-old-frames-stay/85283 "2022-08-04T07:25:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_E\_Lee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kenneth_e_lee/32/35863_2.png) [@Kenneth\_E\_Lee](https://discourse.julialang.org/u/Kenneth_E_Lee)\
**Post date:** [August 4, 2022, 7:25am UTC](https://discourse.julialang.org/t/julia-glmakie-plotting-contour-animation-old-frames-stay/85283/1 "2022-08-04T07:25:50Z")

</div>

Trying to use the GLMakie.record() function to make an animation of GLMakie.contour!() 3D contour plots. The code is quite classic. I will just list out the structure of it.  
@lift GLMakie.contour!(ax, xx.val, yy.val, zz, wArr1)  
where xx, yy, and wArr1 are changing with time steps. So they are set as Observables.  
At the end, I did:  
frames = 2:length(times)  
save\_fname = “./lag\_20220802v8.mp4”  
GLMakie.record(fig, save\_fname, frames, framerate=8) do i  
msg = string("Plotting frame ", i, " of “, frames[end])  
print(msg \* " \r”)  
n = i  
end

However, the animation does NOT show the contour plot at all. Then I went back and check each frame by updating the Observable time step, frame by frame. I found the latest contour plot still keeps the old contour plots in it. Can anyone give some advice on what might be happening?

![Screenshot from 2022-08-04 09-19-33](https://global.discourse-cdn.com/julialang/original/3X/b/2/b2b289bfe4f130e7b3a3f995633e5c672b2d47d0.png)

---

<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 4, 2022, 10:48am UTC](https://discourse.julialang.org/t/julia-glmakie-plotting-contour-animation-old-frames-stay/85283/2 "2022-08-04T10:48:03Z")

</div>

Your code example is very hard to read, you should try to format it and use the ````julia` block.

One problem is `@lift GLMakie.contour!(ax, xx.val, yy.val, zz, wArr1)` …  
Not sure where you got that from, but that’s not how you use `@lift`.  
I suggest reading the [animation docs](https://makie.juliaplots.org/stable/documentation/animation/) and/or the `@lift` docs (in the repl press `?@lift`)…
