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

Skip to content

Commit 54a914f

Browse files
vamshipystory645
andauthored
Update galleries/examples/animation/animated_FuncAnimation.py
Co-authored-by: hannah <[email protected]>
1 parent ec824ff commit 54a914f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

galleries/examples/animation/animated_FuncAnimation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,18 @@ def update(frame, line, text, decades, widgets_data):
4545

4646
# Set up the initial plot
4747
fig, ax = plt.subplots()
48-
ax.set_xlim(1940, 2020)
49-
ax.set_ylim(0, max(widgets_data) + 100000)
48+
49+
#line being animated
5050
line, = ax.plot([], [])
51-
ax.set_xlabel('Decade')
52-
ax.set_ylabel('Number of Widgets')
5351

5452
# Text annotation to display the current decade
5553
text = ax.text(0.5, 0.85, '', transform=ax.transAxes,
5654
fontsize=12, ha='center', va='center')
55+
56+
ax.set(xlabel = 'Decade', ylabel='Number of Widgets',
57+
xlim=(1940, 2020),
58+
ylim = (0, max(widgets_data) + 100000) )
59+
5760

5861
ani = animation.FuncAnimation(
5962
fig, # Figure to update

0 commit comments

Comments
 (0)