Again... 'plot' creates a new Plot, and 'plot!' adds to or updates an
existing Plot. Your second plot command need an exclamation point.

On Wednesday, June 29, 2016, Henri Girard <[email protected]> wrote:

> Hi,
> I can't get a sinusoidal like with pyplot, I got it once but I lost my
> config.
> Any help ?
>
>
>
> using Sundials,ODE,Plots
> pyplot(size=(300,200),leg=false,
> guidefont=font(7), titlefont=font(7));
> function oscillator(t, y, ydot)
>     ydot[1] = y[2]
>     ydot[2] = - 3 * y[1] - y[2] / 10
> end
> initial = [1.0,0.0];                   # Initial conditions
> t = float([0:1.125:30]);                # Time steps for solution
> xv = Sundials.cvode(oscillator, initial, t);
> xv[1:5,:]
> plot(t,xv[:,1],title="Mouvement",
> bg=RGB(.2,.2,.2),
> xlabel ="Temps",ylabel = "Vitesse")
> vₓ=xv[:,1]
> vᵥ=xv[:,2]
> plot(vₓ,vᵥ,title="Mouvement",
> bg=RGB(.2,.2,.2),
> xlabel ="Temps",ylabel = "Vitesse")
>

Reply via email to