python画箭头线起始终止_如何在matplotlib的注解中设置箭头的起始点?

可以注释箭头的起点。一、 让两个箭头从同一位置开始,没有注释文字,使用第三个没有箭头的注释,用文字注释这个起点。在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来调整箭头的收缩率,将其设置为零将允许两个箭头连接。在

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值