Skip to content

Commit c791f9e

Browse files
committed
Merge pull request matplotlib#3625 from horvatha/master
animate_decay.py example code is less complicated
2 parents d853c82 + 4a1d3c0 commit c791f9e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/animation/animate_decay.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
import matplotlib.animation as animation
44

55

6-
def data_gen():
7-
t = data_gen.t
6+
def data_gen(t=0):
87
cnt = 0
98
while cnt < 1000:
109
cnt += 1
1110
t += 0.05
1211
yield t, np.sin(2*np.pi*t) * np.exp(-t/10.)
13-
data_gen.t = 0
1412

1513
fig, ax = plt.subplots()
1614
line, = ax.plot([], [], lw=2)

0 commit comments

Comments
 (0)