Hi,

I was able to do it using Interact, Reactive and Winston in IJulia.

For example, in one input cell run

using Interact, Reactive, Winston

p = Input(0.0:0.0)
function f(x)
    plot(sin(5*x), sin(2π*x))
    xlim(-1, 1)
    ylim(-1, 1)
end
lift(f, p)



and then, in another cell, run your updating loop:

for i=0:0.05:10
    sleep(1/60)
    push!(p, 0.0:0.01:i)
end

I'm pretty sure this is inefficient and can be very slow for more 
elaborated plots though.

On Thursday, November 27, 2014 11:20:54 AM UTC, Christoph Ortner wrote:
>
> I could not find it, but apologies if this has previously been discussed.
>
> I am interested in outputting numerical results on the fly - not in 
> generating movie files. (I have found some nice examples on how to do the 
> latter.) The following code snippet, run in IJulia opens an external plot 
> window and then displays the animation I want to see.
>
> using PyPlot
> pygui(true)
> x = linspace(0,1,100)
> PyPlot.hold(false)
> for t = -1:.1:1
>     plot(x, t*(1-x).*x)
>     axis([0,1, -.3, .3])
>     PyPlot.draw()
> end
>
> But if I change to pygui(false)  to see the plots within IJulia, then I 
> only get the final graph. Can it be done? What am I missing?
>
> (Strangly, I think I did have it working before, but somehow broke it and 
> cannot figure out again what I did.)
>
> Many thanks,
>    Christoph
>
>
>

Reply via email to