Merge pull request #2403 from daschw/animate

Fix animations for `import Plots`
This commit is contained in:
Daniel Schwabeneder 2020-02-16 11:01:10 +01:00 committed by GitHub
commit 13fc936e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,16 +163,16 @@ function _animate(forloop::Expr, args...; callgif = false)
error("Unsupported animate filter: $args")
end
push!(block.args, :(if $filterexpr; frame($animsym); end))
push!(block.args, :(if $filterexpr; Plots.frame($animsym); end))
push!(block.args, :(global $countersym += 1))
# add a final call to `gif(anim)`?
retval = callgif ? :(gif($animsym)) : animsym
retval = callgif ? :(Plots.gif($animsym)) : animsym
# full expression:
esc(quote
$freqassert # if filtering, check frequency is an Integer > 0
$animsym = Animation() # init animation object
$animsym = Plots.Animation() # init animation object
global $countersym = 1 # init iteration counter
$forloop # for loop, saving a frame after each iteration
$retval # return the animation object, or the gif