In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from ipywidgets import interact

In [13]:
def plot_sine(a,k):
    x = linspace(0,1,1001)
    y = a*sin(pi*k*x)
    plot(x,y,'b')
    ylim(-5,5)
    title('%s sin(%s \pi x)' % (a,k))

In [14]:
plot_sine(3,5)



In [15]:
interact(plot_sine,a=(1,4,1),k=(1,10,1))


Out[15]:
<function __main__.plot_sine>

In [ ]: