Plots & animation

I’m playing around with animation using Plots… Here is what I get:

Question: Is it possible to suppress the plotting (IJulia, Windows 10) of the final plot (above the pink box with my black tipped masking of directories) + suppressing the pink Info message, and only get the animation?

Is it possible to suppress the plotting (IJulia, Windows 10) of the final plot

a additional ; after the plot statement will do the trick ( plot(...); )

suppressing the pink Info message, and only get the animation?

You can change the logger
https://docs.julialang.org/en/v1/stdlib/Logging/

1 Like

I have tried the following:

x_ = sol_samp[1:5,:]
y_ = sol_samp[6:10,:]
#
Mcol = [:black,:red,:orange,:cornflowerblue,:green]
using Logging
NullLogger()
@gif for i=1:5
    fg_anim = scatter(x_[:,i],y_[:,i],xlim=(X11,X12),ylim=(X11,X12),ms=15,mc=Mcol,label="",title="time: $(round(tsamp[i],digits=1)) ps");
    plot(fg_short,fg_anim,layout=(1,2),size=(1000,400));
end

So …

  • I added ; after the plot command. This had no effect; the plot is still being plotted.
  • I tried to set a NullLogger() – no effect.

So there is something I didn’t understand…

hm does

begin
    @gif for i=1:5
        fg_anim = scatter(x_[:,i],y_[:,i],xlim=(X11,X12),ylim=(X11,X12),ms=15,mc=Mcol,label="",title="time: $(round(tsamp[i],digits=1)) ps");
        plot(fg_short,fg_anim,layout=(1,2),size=(1000,400))
    end
end;

change somethng

Yes. If I bracket the code in begin-end, only the final time plot + the pink info box shows up; the animation disappears. Which is kind of the opposite of what I want.

I don’t use Jupyter, I used this as a MWE in juno (something you should provide)

using Plots
x_ =rand(10)
y_ = rand(10)
#
Mcol = [:black,:red,:orange,:cornflowerblue,:green]
using Logging
disable_logging(Logging.Info)
@gif for i=1:5
    #fg_anim = scatter(x_[i],y_[i],ms=15,label="");
    plot(x_,rand(10),layout=(1,2),size=(1000,400))
end

showing the intended behavior

Thanks. So here is the MWE:

xx =rand(10)
#
# using Logging
disable_logging(Logging.Info)
@gif for i=1:5
    plot(xx,rand(10),layout=(1,2),size=(1000,400))
end

This removes the pink info box, and leads to:

In other words: the final time plot is still shown before the animation Out cell. But it looks nicer without the pink info box, so I’m almost at what I want to have.