I can't get the sin graph to appear

Viewed 31

I've written this code from a tutorial where someone is using essentially a jupiter notebook to demonstrate it, however i'm using the sypder ide which i suspect could be a problem. This is the tutorial: https://www.youtube.com/watch?v=41iFw58JmAU&list=PLftKiHShKwSO4Lr8BwrlKU_fUeRniS821&index=27&ab_channel=CarrollMath The graph won't show.

import numpy as np 
import matplotlib.pyplot as plt
from ipywidgets import interactive

x = np.linspace(0, 2*np.pi, 100)

def plotter(A, B):
    y = A*np.sin(B*x)
    plt.plot(x, y)
    plt.grid()
    plt.ylim(-3,3)
    plt.show()



iplot = interactive(plotter,
                    A = (-3,3,0.1),
                    B = (1, 5, 0.5)
                    )
iplot
0 Answers
Related