Python 在“注释”中自定义箭头样式时如何获得精确的收缩值

Python 在“注释”中自定义箭头样式时如何获得精确的收缩值,python,matplotlib,plot,customization,annotate,Python,Matplotlib,Plot,Customization,Annotate,如果愿意在matplotlib中使用自定义箭头样式,可以使用中介绍的方法。但在指定shrinkA或shrinkB时仍然存在问题 我想到了一种使用matplotlib函数计算这些值的方法,但没有成功,而是执行了以下操作: import matplotlib.patches as patches orig = (1.1,2.) target = (1.1,3.) shrinkA = 10. # given in points shrinkB = 0. b = patches.ConnectionS

如果愿意在
matplotlib
中使用自定义箭头样式,可以使用中介绍的方法。但在指定
shrinkA
shrinkB
时仍然存在问题

我想到了一种使用
matplotlib
函数计算这些值的方法,但没有成功,而是执行了以下操作:

import matplotlib.patches as patches

orig = (1.1,2.)
target = (1.1,3.)
shrinkA = 10. # given in points
shrinkB = 0.
b = patches.ConnectionStyle('arc')
path = b.connect( orig, target )
path = b._shrink( path, shrinkA, shrinkB )

但是当我这样做时,
path
不会发生任何事情。。。有什么建议吗?

该方法非常正确,似乎
shrinkA
shrinkB
应该以
0.
1.之间的比值给出。

orig =   (1.1,2.)
target = (1.1,7.)
shrinkA = 0.1 # given in points
shrinkB = 0.1
b = patches.ConnectionStyle('Arc')
path = b.connect( orig, target )
path = b._shrink( path, shrinkA, shrinkB )
要获取
orig
target
的新值:

neworig, newtarget = path.vertices