Skip to main content
 首页 » 编程设计

python之Matplotlib注解详细文档

2024年11月01日12JustinYoung

很抱歉,我真的试图在文档中找到以下内容:

armA、armB、angleA、angleB 在plt.annotate 中分别代表什么意思?例如,在:

ax.annotate('arc', xy=(1.5, -1),  xycoords='data', 
            xytext=(-40, -30), textcoords='offset points', 
            arrowprops=dict(arrowstyle="->", connectionstyle= 
            "arc,angleA=0,armA=20,angleB=-90,armB=15,rad=7"),) 

非常感谢!

请您参考如下方法:

这些参数用于初始化 ConnectionStyle.Arc 类。详细可以看here .

class ConnectionStyle.Arc(angleA=0, angleB=0, armA=None, armB=None, rad=0.0)

Bases: matplotlib.patches._Base

Creates a picewise continuous quadratic bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with rad.

angleA : starting angle of the path

angleB : ending angle of the path

armA : length of the starting arm

armB : length of the ending arm

rad : rounding radius of the edges

connect(posA, posB)