Merge pull request #1650 from mkborregaard/master
1.0 updates to animations
This commit is contained in:
commit
afb7a17e5f
@ -87,7 +87,7 @@ function buildanimation(animdir::AbstractString, fn::AbstractString,
|
|||||||
run(`ffmpeg -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -pix_fmt yuv420p -y $fn`)
|
run(`ffmpeg -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -pix_fmt yuv420p -y $fn`)
|
||||||
end
|
end
|
||||||
|
|
||||||
show_msg && info("Saved animation to ", fn)
|
show_msg && @info("Saved animation to ", fn)
|
||||||
AnimatedGif(fn)
|
AnimatedGif(fn)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ function _animate(forloop::Expr, args...; callgif = false)
|
|||||||
end
|
end
|
||||||
|
|
||||||
push!(block.args, :(if $filterexpr; frame($animsym); end))
|
push!(block.args, :(if $filterexpr; frame($animsym); end))
|
||||||
push!(block.args, :($countersym += 1))
|
push!(block.args, :(global $countersym += 1))
|
||||||
|
|
||||||
# add a final call to `gif(anim)`?
|
# add a final call to `gif(anim)`?
|
||||||
retval = callgif ? :(gif($animsym)) : animsym
|
retval = callgif ? :(gif($animsym)) : animsym
|
||||||
@ -151,7 +151,7 @@ function _animate(forloop::Expr, args...; callgif = false)
|
|||||||
esc(quote
|
esc(quote
|
||||||
$freqassert # if filtering, check frequency is an Integer > 0
|
$freqassert # if filtering, check frequency is an Integer > 0
|
||||||
$animsym = Animation() # init animation object
|
$animsym = Animation() # init animation object
|
||||||
$countersym = 1 # init iteration counter
|
global $countersym = 1 # init iteration counter
|
||||||
$forloop # for loop, saving a frame after each iteration
|
$forloop # for loop, saving a frame after each iteration
|
||||||
$retval # return the animation object, or the gif
|
$retval # return the animation object, or the gif
|
||||||
end)
|
end)
|
||||||
|
|||||||
@ -43,7 +43,7 @@ end
|
|||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
function add_backend(pkg::Symbol)
|
function add_backend(pkg::Symbol)
|
||||||
info("To do a standard install of $pkg, copy and run this:\n\n")
|
@info("To do a standard install of $pkg, copy and run this:\n\n")
|
||||||
println(add_backend_string(_backend_instance(pkg)))
|
println(add_backend_string(_backend_instance(pkg)))
|
||||||
println()
|
println()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -173,10 +173,10 @@ function _show(io::IO, ::MIME"text/html", plt::Plot)
|
|||||||
output_type = get(_best_html_output_type, backend_name(plt.backend), :svg)
|
output_type = get(_best_html_output_type, backend_name(plt.backend), :svg)
|
||||||
end
|
end
|
||||||
if output_type == :png
|
if output_type == :png
|
||||||
# info("writing png to html output")
|
# @info("writing png to html output")
|
||||||
print(io, "<img src=\"data:image/png;base64,", base64encode(show, MIME("image/png"), plt), "\" />")
|
print(io, "<img src=\"data:image/png;base64,", base64encode(show, MIME("image/png"), plt), "\" />")
|
||||||
elseif output_type == :svg
|
elseif output_type == :svg
|
||||||
# info("writing svg to html output")
|
# @info("writing svg to html output")
|
||||||
show(io, MIME("image/svg+xml"), plt)
|
show(io, MIME("image/svg+xml"), plt)
|
||||||
elseif output_type == :txt
|
elseif output_type == :txt
|
||||||
show(io, MIME("text/plain"), plt)
|
show(io, MIME("text/plain"), plt)
|
||||||
|
|||||||
@ -177,7 +177,7 @@ function _plot!(plt::Plot, d::KW, args::Tuple)
|
|||||||
|
|
||||||
kw_list = _process_userrecipes(plt, d, args)
|
kw_list = _process_userrecipes(plt, d, args)
|
||||||
|
|
||||||
# info(1)
|
# @info(1)
|
||||||
# map(DD, kw_list)
|
# map(DD, kw_list)
|
||||||
|
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ function _plot!(plt::Plot, d::KW, args::Tuple)
|
|||||||
_process_plotrecipe(plt, next_kw, kw_list, still_to_process)
|
_process_plotrecipe(plt, next_kw, kw_list, still_to_process)
|
||||||
end
|
end
|
||||||
|
|
||||||
# info(2)
|
# @info(2)
|
||||||
# map(DD, kw_list)
|
# map(DD, kw_list)
|
||||||
|
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
@ -212,7 +212,7 @@ function _plot!(plt::Plot, d::KW, args::Tuple)
|
|||||||
# "SERIES RECIPES"
|
# "SERIES RECIPES"
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|
||||||
# info(3)
|
# @info(3)
|
||||||
# map(DD, kw_list)
|
# map(DD, kw_list)
|
||||||
|
|
||||||
for kw in kw_list
|
for kw in kw_list
|
||||||
|
|||||||
@ -9,7 +9,7 @@ using VisualRegressionTests
|
|||||||
# ENV["MPLBACKEND"] = "Agg"
|
# ENV["MPLBACKEND"] = "Agg"
|
||||||
# try
|
# try
|
||||||
# @eval import PyPlot
|
# @eval import PyPlot
|
||||||
# info("Matplotlib version: $(PyPlot.matplotlib[:__version__])")
|
# @info("Matplotlib version: $(PyPlot.matplotlib[:__version__])")
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ const _current_plots_version = v"0.17.4"
|
|||||||
function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = isinteractive(), sigma = [1,1], eps = 1e-2)
|
function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = isinteractive(), sigma = [1,1], eps = 1e-2)
|
||||||
Plots._debugMode.on = debug
|
Plots._debugMode.on = debug
|
||||||
example = Plots._examples[idx]
|
example = Plots._examples[idx]
|
||||||
info("Testing plot: $pkg:$idx:$(example.header)")
|
@info("Testing plot: $pkg:$idx:$(example.header)")
|
||||||
backend(pkg)
|
backend(pkg)
|
||||||
backend()
|
backend()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user