In [1]:
import matplotlib.pyplot as plt
from ipywidgets import interact, IntSlider
%matplotlib inline

In [2]:
x = IntSlider()
@interact(n=x)
def f(n):
    plt.plot([0,n])
    plt.show()



In [3]:
@interact(n=x)
def f(n):
    plt.plot([0,n,0,n])
    plt.show()



In [ ]: