# How do I make @progress and @animate play nice together?

**URL:** <https://discourse.julialang.org/t/how-do-i-make-progress-and-animate-play-nice-together/22760>\
**Category:** New to Julia\
**Tags:** plots, animations\
**Created:** [April 4, 2019, 4:10pm UTC](https://discourse.julialang.org/t/how-do-i-make-progress-and-animate-play-nice-together/22760 "2019-04-04T16:10:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrPapa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drpapa/32/6835_2.png) [@DrPapa](https://discourse.julialang.org/u/DrPapa)\
**Post date:** [April 4, 2019, 4:10pm UTC](https://discourse.julialang.org/t/how-do-i-make-progress-and-animate-play-nice-together/22760/1 "2019-04-04T16:10:35Z")

</div>

I am creating some gifs using the @animate macro in Plots.jl that are time consuming to make. I would like to display the progress with Juno.@progress. Unfortunately, stacking the two doesn’t work directly, e.g.

```julia
using Juno, Plots
@progress @animate for ii = 1:3
    scatter([ii,],[ii,])
end
ERROR: LoadError: @progress requires a for loop (for i in irange, j in jrange, ...; <body> end) or array comprehension with assignment (x = [<body> for i in irange, j in jrange, ...])

```

and

```julia
@animate @progress for ii = 1:3
    scatter([ii,],[ii,])
end
ERROR: LoadError: @animate macro expects a for-block. got: macrocall

```

Any suggestions of how to proceed? Thanks.

---

<div class="post-metadata">

**Author:** ![rmcsqrd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rmcsqrd/32/23384_2.png) [@rmcsqrd](https://discourse.julialang.org/u/rmcsqrd)\
**Post date:** [September 15, 2020, 8:51pm UTC](https://discourse.julialang.org/t/how-do-i-make-progress-and-animate-play-nice-together/22760/2 "2020-09-15T20:51:53Z")

</div>

Late to the party but replying because I had a similar question. Here is my solution which is pretty much verbatim from [GitHub - timholy/ProgressMeter.jl: Progress meter for long-running computations](https://github.com/timholy/ProgressMeter.jl).

```julia
using ProgressMeter

n=10
p = Progress(n)

@animate for i in 1:n
   # do stuff
   next!(p)
end

```

---

<div class="post-metadata">

**Author:** ![DrPapa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drpapa/32/6835_2.png) [@DrPapa](https://discourse.julialang.org/u/DrPapa)\
**Post date:** [September 16, 2020, 1:27pm UTC](https://discourse.julialang.org/t/how-do-i-make-progress-and-animate-play-nice-together/22760/3 "2020-09-16T13:27:48Z")

</div>

Thanks!
