real time plotting with Julia

Viewed 2547

I am trying to plot a function evolving in real time with Julia.

For that, I saw that GR package could be used in Julia, when I try to apply exactly the example given here :

import GR
GR.inline("mov")
x = [0:0.01:2*pi]

    for i = 1:200
    GR.plot(x, sin.(x + i / 10.0))
    end

GR.show()

I get the following error message while executing the loop part :

expected Real or Complex

in #plot_args#12(::Symbol, ::Function, ::Tuple{Array{FloatRange{Float64},1},Array{Array{Float64,1},1}}) at /Users/myname/.julia/v0.5/GR/src/jlgr.jl:936 ....

I have looked a bit on internet and found this where someone seems to have a similar problem but I really dont understand the answers and what should I do to make it work.

I can also just find an other way to plot in real time (within a loop).

Can someone help with that please?

Thank you by advance

1 Answers
Related