# Plots, animation, problem with indendent layout

**URL:** <https://discourse.julialang.org/t/plots-animation-problem-with-indendent-layout/51302>\
**Category:** Visualization\
**Created:** [December 5, 2020, 2:55pm UTC](https://discourse.julialang.org/t/plots-animation-problem-with-indendent-layout/51302 "2020-12-05T14:55:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DIzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dizer/32/3971_2.png) [@DIzer](https://discourse.julialang.org/u/DIzer)\
**Post date:** [December 5, 2020, 2:55pm UTC](https://discourse.julialang.org/t/plots-animation-problem-with-indendent-layout/51302/1 "2020-12-05T14:55:07Z")

</div>

Hello everybody,  
I need to animate a peace of experimental data. The outline of calculation is below.

> … #some calculations  
> anim = Animation()  
> l = @layout [a; c{0.2h}]  
> for (n\_, line) in enumerate(lines1)  
> … #some calculations  
> if stp == 100  
> … #some calculations  
> plot( plot(VU, LH, st = scatter), plot( DT, AP, st = scatter), layout = l)  
> frame(anim)  
> …#some calculations  
> end  
> end  
> gif(anim, “hhh.gif”, fps=15)

VU, LH - are fixed sized Float64 vectors  
DT, AP - are variable sized Time and Float64 vectors

The Animation is OK if there is only one plot.  
If there are two plots i got only one (the first) frame rendered in the animation (the rest are blank).  
It looks like a need to enforce recalculating Plot’s internals in the cycle before plotting and framing.  
Is it possible to fix the problem?  
Thanks, to advance

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [December 5, 2020, 3:39pm UTC](https://discourse.julialang.org/t/plots-animation-problem-with-indendent-layout/51302/2 "2020-12-05T15:39:18Z")

</div>

> [@DIzer](#):
>
> l = @layout [a; c{0.2h}]

What happens if this goes to inside of for-loop? I had the experience that a layout object can only be used one time. I don’t know if it is expected.

---

<div class="post-metadata">

**Author:** ![DIzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dizer/32/3971_2.png) [@DIzer](https://discourse.julialang.org/u/DIzer)\
**Post date:** [December 5, 2020, 3:52pm UTC](https://discourse.julialang.org/t/plots-animation-problem-with-indendent-layout/51302/3 "2020-12-05T15:52:21Z")

</div>

and … You are right! Thank you, very much,
