Plotlyjs - animation errors in examples https://juliaplots.github.io/examples/plotlyjs/

Almost all example from https://juliaplots.github.io/examples/plotlyjs/ runs well under Jupyter notebook (some as is, some after minor Julia/Pkg fixes due to version updates).

But 3 errors I can’t easy fix:

  1. Animation
    p = plot([sin,cos],zeros(0),leg=false)
    anim = Animation()
    for x = linspace(0,10π,100)
    push!(p,x,Float64[sin(x),cos(x)])
    frame(anim)
    end

MethodError: no method matching handle_new_from_data(::Dict{String,Any})
Closest candidates are:
** handle_new_from_data(::AbstractString) at /home/o/.julia/v0.5/Rsvg/src/calls.jl:69**
** handle_new_from_data(::AbstractString, ::Gtk.GLib.GError) at /home/o/.julia/v0.5/Rsvg/src/calls.jl:61**

  1. Styles
    styles = setdiff(supported_styles(),[:auto])’
    plot(cumsum(randn(20,length(styles)),1),style=:auto,label=map(string,styles),w=5)

UndefVarError: supported_styles not defined

  1. Markers
    markers = setdiff(supported_markers(),[:none,:auto,Shape])’
    n = length(markers)
    x = (linspace(0,10,n + 2))[2:end - 1]
    y = repmat(reverse(x)',n,1)
    scatter(x,y,m=(8,:auto),lab=map(string,markers),bg=:linen,xlim=(0,10),ylim=(0,10))

UndefVarError: supported_markers not defined

I am using Julia 0.5.2 latest version as of today

Can someone help? Thanks.

For 2 and 3: There is a small error in the docs, as supported_styles is not exported. This should be Plots.supported_styles() and Plots.supported_markers() instead. Do you feel like making a PR against https://github.com/JuliaPlots/PlotDocs.jl/tree/master/docs/examples (I think the pages for all backends should be updated)?

1 Like

For animations in jupyter, try creating a gif instead - like the example of the lorenz attractor on the home page. If you keep getting an error perhaps open an issue on Plots.

Thank you - it works for 2 and 3 after fixes.

Yes, updating all backends examples should be quite useful for newcomers. On the other hands, Julia itself is evolving a lot, so some changes and bugs are expected.

Animation has failed for gif also - I have opened an issue on Plots.

Thanks.