scipy2017-jupyter-widgets-tutorial icon indicating copy to clipboard operation
scipy2017-jupyter-widgets-tutorial copied to clipboard

widgets do not function properly in a new window

Open bwanaaa opened this issue 5 years ago • 0 comments

%matplotlib qt
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np

def f(m, b):
    plt.figure(2)
    x = np.linspace(-10, 10, num=1000)
    plt.plot(x, m * x + b)
    plt.ylim(-5, 5)
    plt.show()
interactive_plot = interactive(f, m=(-2.0, 2.0), b=(-3, 3, 0.5))
interactive_plot

This just plots all the lines in different colors in the same window. It seems it keeps a history of EVERY line and does not dynamically update the window.

bwanaaa avatar Mar 04 '20 00:03 bwanaaa