擅长:python、mysql、java
<p>马上打印<code>(x, y)</code>怎么样。</p>
<pre><code>from matplotlib import pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
A = -0.75, -0.25, 0, 0.25, 0.5, 0.75, 1.0
B = 0.73, 0.97, 1.0, 0.97, 0.88, 0.73, 0.54
plt.plot(A,B)
for xy in zip(A, B): # <--
ax.annotate('(%s, %s)' % xy, xy=xy, textcoords='data') # <--
plt.grid()
plt.show()
</code></pre>
<p><img src="https://i.stack.imgur.com/Bhqbj.png" alt="enter image description here"/></p>