Created
April 2, 2020 14:47
-
-
Save kervel/6f4c554a121983292f24a040d3bfd291 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = np.linspace(0, 2 * np.pi, 100) | |
fig, ax = plt.subplots() | |
line, = ax.plot(x, np.sin(x)) | |
ax.grid(True) | |
def update(change): | |
line.set_ydata(np.sin(change.new * x)) | |
fig.canvas.draw() | |
int_slider = widgets.IntSlider( | |
value=1, | |
min=0, max=10, step=1, | |
description='$\omega$', | |
continuous_update=False | |
) | |
int_slider.observe(update, 'value') | |
int_slider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment