from IPython.html.widgets import interact %matplotlib inline import matplotlib.pyplot as plt import numpy as np def plot_sine(n): x = np.arange(0, 20, 0.1); y = np.sin(x/n) plt.plot(x, y) interact(plot_sine, n=(1,10, 0.1))