Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import matplotlib.animation as animation
- MAX_FRAMES = 50
- xs, ys = [], []
- obj = None
- def update(frame_number):
- xs.append(frame_number)
- ys.append(frame_number)
- obj.set_data(xs, ys)
- fig = plt.figure()
- ax = plt.axes()
- ax.set_ylim(-1, 100)
- ax.set_xlim(-1, 100)
- obj, = plt.plot([], [], 'ro')
- anim = animation.FuncAnimation(
- fig, update, MAX_FRAMES, interval=100, repeat=False)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement