擅长:python、mysql、java
<pre><code>import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
x = [1, 2, 3, 4]
y = [5, 6, 7, 8]
for t in range(10):
plt.cla()
plt.text(4.6,6.7,t)
x = np.random.randint(10, size=5)
y = np.random.randint(10, size=5)
points, = ax.plot(x, y, marker='o', linestyle='None')
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
plt.pause(0.5)
</code></pre>
<p>注意<code>plt.cla()</code>调用。它会清除屏幕。</p>