Santiago Tejada
Santiago Tejada

Reputation: 13

ipywidgets jupyter notebook

enter image description here

I updated my version of Anaconda and when i try to use ipywidgets in Jupyter notebook i get several graphics instead of an interactive one:

%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))

Upvotes: 1

Views: 683

Answers (1)

Jacques Kvam
Jacques Kvam

Reputation: 3076

Try adding plt.show() after you call plt.plot().

https://github.com/jupyter-widgets/ipywidgets/issues/1181#issuecomment-284172632

Upvotes: 1

Related Questions