Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %matplotlib widget
- from ipywidgets import *
- import numpy as np
- import matplotlib.pyplot as plt
- x = np.linspace(0, 2 * np.pi)
- fig = plt.figure()
- ax = fig.add_subplot(1, 1, 1)
- line, = ax.plot(x, np.sin(x))
- def update(w = 1.0):
- line.set_ydata(np.sin(w * x))
- fig.canvas.draw_idle()
- interact(update);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement