PGFPlots.jl
PGFPlots.jl copied to clipboard
Reel Support
Reel.jl lets you string frames together into videos (or gifs, etc.) I figured out how to use it with PGFPlots, but it requires setting (a very small number of) things to get it to work:
using PGFPlots
using Reel
Reel.set_output_type("gif") // I use this - may not strictly be required
Reel.extension(m::MIME"image/svg+xml") = "svg"
frames = Frames(MIME("image/svg+xml"), fps=10)
for frame in 1:10
t = rad2deg(linspace(0,5pi,60))
x = sind(t)
y = cosd(t)
z = 2t/(5pi)
p = Plots.Linear3(x, y, z, mark="none")
view=@sprintf("{%f}{30}", rad2deg(frame*0.1))
ax = Axis(p, view=view, xlabel="x", ylabel="y", zlabel="z")
push!(frames, ax)
end
frames
Would we like to support this directly? Should we just add an example to the docs without supporting it directly?
I would love for this to be supported directly! Lots of people want animated plots! It would be nice to make the interface for doing this really slick.
So it looks like we only need:
- to include Reel
- add
Reel.extension(m::MIME"image/svg+xml") = "svg"
- add some method for getting a
Frames
object with the desired MIME. - maybe reexport Reel
- document some examples
The rest is handled by Reel.
Would like to pull this in, but Reel hasn't issued a new tag in ages.
I asked to be made a collaborator on https://github.com/shashi/Reel.jl/issues/11.
See 1263193
I would say that better than Reel.jl is the gif interface of Plots.jl: https://juliaplots.github.io/ Scroll down a little to see the first example with the Lorenz Attractor.
More documentation is available here.