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

Skip to content

Commit 81ca82c

Browse files
authored
Merge pull request #23782 from QuLogic/no-cla-examples
Remove `Axes.cla` from examples
2 parents 7c6a74c + 6a24855 commit 81ca82c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/animation/animation_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
fig, ax = plt.subplots()
2222

23-
for i in range(len(data)):
24-
ax.cla()
25-
ax.imshow(data[i])
26-
ax.set_title("frame {}".format(i))
23+
for i, img in enumerate(data):
24+
ax.clear()
25+
ax.imshow(img)
26+
ax.set_title(f"frame {i}")
2727
# Note that using time.sleep does *not* work here!
2828
plt.pause(0.1)

examples/event_handling/data_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def update(self):
7575

7676
dataind = self.lastind
7777

78-
ax2.cla()
78+
ax2.clear()
7979
ax2.plot(X[dataind])
8080

8181
ax2.text(0.05, 0.9, f'mu={xs[dataind]:1.3f}\nsigma={ys[dataind]:1.3f}',

0 commit comments

Comments
 (0)