In [16]:
import ipywidgets as wgt
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [17]:
def f(a,b,c):
    x = np.linspace(0,10,1000)
    y = np.cos(a*x + b) + c
    plt.plot(x,y)
    plt.ylim([-3,3])
    plt.show() 

wgt.interact(f, a=(-5,5,3), b=(-5,5), c=(-6,6));     # try adding string and list arguments...
In [18]:
def f(m, b):
    x = np.linspace(-10, 10, num=1000)
    y = m*x + b
    plt.plot(x, y)
    plt.ylim(-5,5)
    plt.show()

interactive_plot = wgt.interactive(f, m=(-2.0, 2.0), b=(-3, 3, 0.5))
interactive_plot
In [ ]: