Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa4f317

Browse files
committed
Fix the animation issue: "animated=True" was the culprit"
1 parent c0dffe1 commit aa4f317

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/animation/rain.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# -----------------------------------------------------------------------------
55
import matplotlib
66
import numpy as np
7-
matplotlib.use('TkAgg') # Required on OSX for animation
87
import matplotlib.pyplot as plt
98
from matplotlib.animation import FuncAnimation
109

@@ -20,8 +19,8 @@
2019
('color', float, 4)])
2120

2221
# Scatter plot is used to animate rain drops
23-
scat = ax.scatter(P['position'][:,0], P['position'][:,1], P['size'], lw=0.5,
24-
animated=True, edgecolors = P['color'], facecolors='none')
22+
scat = ax.scatter(P['position'][:,0], P['position'][:,1], P['size'],
23+
lw=0.5, edgecolors = P['color'], facecolors='none')
2524
ax.set_xlim(0,1), ax.set_xticks([])
2625
ax.set_ylim(0,1), ax.set_yticks([])
2726

@@ -55,5 +54,5 @@ def update(frame):
5554

5655
return scat,
5756

58-
animation = FuncAnimation(fig, update, interval=10, blit=True)
57+
animation = FuncAnimation(fig, update, interval=10)
5958
plt.show()

0 commit comments

Comments
 (0)