CHAPTER 03 · 作品已接入
注释文本
用 annotate() 与 text() 在图表中添加说明文字。
import matplotlib.pyplot as plt
plt.plot(x, y)
plt.text(6, 70, 'y = 0.8x + 12')
plt.annotate('local dip', xy=(4, 23),
arrowprops=dict(arrowstyle='->'))
plt.show()
CHAPTER 03 · 作品已接入
用 annotate() 与 text() 在图表中添加说明文字。
import matplotlib.pyplot as plt
plt.plot(x, y)
plt.text(6, 70, 'y = 0.8x + 12')
plt.annotate('local dip', xy=(4, 23),
arrowprops=dict(arrowstyle='->'))
plt.show()