Python 箭头的悬垂属性在注释中不起作用
我想为matplotlib中注释的箭头样式设置悬挑。使用Python 箭头的悬垂属性在注释中不起作用,python,matplotlib,Python,Matplotlib,我想为matplotlib中注释的箭头样式设置悬挑。使用Axes.arrow()设置overhang-属性可以找到,在Axes.annotate()的arrowprops-属性中设置它 MWE: 在哪里以及如何设置“悬垂”属性 import matplotlib.pyplot as plt ax = plt.axes() ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1, overhang=0.2) ax.annotate(
Axes.arrow()
设置overhang
-属性可以找到,在Axes.annotate()
的arrowprops
-属性中设置它
MWE:
在哪里以及如何设置“悬垂”属性
import matplotlib.pyplot as plt
ax = plt.axes()
ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1, overhang=0.2)
ax.annotate(
"Test",
(0, 0.5),
(0.5, 0),
arrowprops=dict(arrowstyle="-|>,head_width=1.05, head_length=1"),
)
# # Fails:
# ax.annotate(
# "Test",
# (0, 0.5),
# (0.5, 0),
# arrowprops=dict(arrowstyle="-|>,head_width=1.05, head_length=1, overhang=1"),
# )
# # Fails:
# ax.annotate(
# "Test",
# (0, 0.5),
# (0.5, 0),
# arrowprops=dict(arrowstyle="-|>,head_width=1.05, head_length=1", overhang=1),
#
# )
# # Fails:
# ax.annotate(
# "Test",
# (0, 0.5),
# (0.5, 0),
# arrowprops=dict(arrowstyle="-|>,head_width=1.05, head_length=1"),
# overhang=1,
# )
plt.show()