Last active
January 8, 2018 03:02
-
-
Save Philmod/c76313c41fe7a3a2ec229a58b3c77292 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
import matplotlib.pyplot as plt | |
import numpy as np | |
import time | |
%matplotlib notebook | |
x = np.linspace(0, 10*np.pi, 100) | |
y = np.sin(x) | |
plt.ion() | |
fig,ax = plt.subplots(1,1) | |
line1, = ax.plot(x, y, 'b-') | |
fig.canvas.draw() | |
for phase in np.linspace(0, 10*np.pi, 5): | |
line1.set_ydata(np.sin(0.5 * x + phase)) | |
ax.set_title('phase ' + str(phase)) | |
fig.canvas.draw() | |
plt.pause(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This isn't an ipynb file, but just a Python file.
Also, there is a bug in matplotlib that has a drawing glitch: matplotlib/matplotlib#9606