Plots library example not working: @gif not defined

464 views
Skip to first unread message

Uwe Fechner

unread,
Mar 6, 2016, 3:07:56 PM3/6/16
to julia-users
Hello,

I am trying to fun the following example from
http://plots.readthedocs.org/en/latest/

using
Plots pyplot(size=(300,300)) # initialize the attractor n = 3000 dt = 0.02 σ, ρ, β = 10., 28., 8/3 x, y, z = 1., 1., 1. X, Y, Z = [x], [y], [z] # build an animated gif, saving every 10th frame @gif for i=1:n dx = σ*(y - x); x += dt * dx; push!(X,x) dy = x*(ρ - z) - y; y += dt * dy; push!(Y,y) dz = x*y - β*z; z += dt * dz; push!(Z,z) plot3d(X,Y,Z) end every 10

I get the error message:

ERROR: LoadError: UndefVarError: @gif not defined

Any idea, where @gif should be defined?

Best regards:

Uwe

Tom Breloff

unread,
Mar 6, 2016, 4:09:20 PM3/6/16
to julia...@googlegroups.com
I should tag a new version. Pkg.checkout("Plots") should do the trick. 

Uwe Fechner

unread,
Mar 6, 2016, 4:19:10 PM3/6/16
to julia-users
Well, no this error went away, but the effect is nevertheless problematic:

It launches PyPlot, and then opens hundreds of windows until the computer
stalls.

Any idea?

Tom Breloff

unread,
Mar 6, 2016, 4:20:30 PM3/6/16
to julia...@googlegroups.com
Just a quick warning... That example is not very performant, as it creates a new figure for every iteration. I need to add push/append for 3D data to allow adding points to the same figure. 

Tom Breloff

unread,
Mar 7, 2016, 1:21:30 PM3/7/16
to julia...@googlegroups.com
FYI: If you check out the dev branch (Pkg.checkout("Plots","dev")) and install GR (Pkg.add("GR")), then this example runs much better with the GR backend.  (disclaimer: GR support is still a work in progress... thanks to Josef Heinen for the development effort.)
Reply all
Reply to author
Forward
0 new messages