Created
July 16, 2019 03:48
-
-
Save DataSolveProblems/35dfc302ef8a1cabe9377b67f85fa249 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 numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
x_data = [] | |
y_data = [] | |
fig, ax = plt.subplots() | |
ax.set_xlim(0, 105) | |
ax.set_ylim(0, 12) | |
line, = ax.plot(0, 0) | |
def animation_frame(i): | |
x_data.append(i * 10) | |
y_data.append(i) | |
line.set_xdata(x_data) | |
line.set_ydata(y_data) | |
return line, | |
animation = FuncAnimation(fig, func=animation_frame, frames=np.arange(0, 10, 0.1), interval=10) | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment