2017-07-02 356 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)) 

回答