可以注释箭头的起点。一、 让两个箭头从同一位置开始,没有注释文字,使用第三个没有箭头的注释,用文字注释这个起点。在import matplotlib.pyplot as plt
plt.plot( [1,2], [1,2], 'o' )
plt.xlim( [0,3] )
plt.ylim( [0,3] )
plt.annotate( "", xy=(1,1), xytext=(1.3, 2.5),
arrowprops=dict( arrowstyle="->" ) )
plt.annotate( '', xy=(2,2), xytext=(1.3, 2.5),
arrowprops=dict( arrowstyle="->" ) )
plt.annotate( 'Some annotation', xy=(1.3, 2.5),
xytext=(1.3, 2.5) , va = "bottom", ha="center" )
plt.annotate( "", xy=(1,1), xytext=(1.5, .5),
arrowprops=dict( arrowstyle="->",shrinkA=0 ) )
plt.annotate( '', xy=(2,2), xytext=(1.5, .5),
arrowprops=dict( arrowstyle="->",shrinkA=0 ) )
plt.annotate( 'Yet another annotation', xy=(1.5, .5),
xytext=(1.5, .5) , va = "top", ha="left" )
plt.show()
您可以使用arrowprops键shrinkA来调整箭头的收缩率,将其设置为零将允许两个箭头连接。在