2017-07-02 414 views
1

enter image description hereipywidgets jupyter筆記本

我更新的版本蟒蛇的,當我嘗試在Jupyter筆記本使用ipywidgets我得到幾個圖形,而不是一個交互:

%matplotlib inline 
from matplotlib import pyplot as plt 
import numpy as np 

from ipywidgets import interact 

def pinta(freq): 
    x = np.linspace(0,3,200) 
    y = x * np.sin(freq * x) 

    plt.plot(x,y,'r') 

interact(pinta, freq= (2 * np.pi, 2 * np.pi *10)) 

回答