python-matplotlib-annotate_添加图形内容细节指向

import matplotlib.pyplot as plt
import numpy as np
x=np.linspace(0.05,10,1000)
y=np.sin(x)
plt.plot(x,y,ls="-.",lw=2.3,color="black",label="sin()")
plt.annotate("maxvalues",xy=(7.8,1.0),xytext=(4.5,0.9),weight="bold",color="black",arrowprops=dict(arrowstyle="->",connectionstyle="arc3",color="r"))
plt.legend()
plt.show()

posted @ 2019-08-22 21:44  朵朵奇fa  阅读(931)  评论(0编辑  收藏  举报