8000 Merge pull request #3625 from horvatha/master · matplotlib/matplotlib@c791f9e · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c791f9e

Browse files
committed
Merge pull request #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

Lines changed: 1 addition & 3 deletions
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)
0