[英]how to make arrow thinner matplotlib
I plot an arrow as below, whilst I think it's a little bit big. 我在下面画一个箭头,虽然我认为它有点大。 How can I make it thinner and smaller? 我怎样才能让它变得更薄更小? Thank you 谢谢
for i in range(len(x)):
plt.annotate(df.index[i],xy=(x[i],y[i]),xytext=(x[i]+1.31,y[i]-0.55),arrowprops=dict(facecolor='blue', shrink=0.1))
You should try adjusting the width
parameter (from the docs ) 你应该尝试调整width
参数(来自文档 )
plt.annotate(df.index[i],
xy=(x[i],y[i]), xytext=(x[i]+1.31,y[i]-0.55),
arrowprops=dict(facecolor='blue', shrink=0.1, width=2)
)
I've adjusted your snippet to make the parameter more obvious. 我调整了你的代码片段,使参数更加明显。 Note also that width
is in points, so you may need to try a few different values out. 另请注意, width
以width
为单位,因此您可能需要尝试一些不同的值。 Other values worth looking at are frac
. 值得关注的其他值是frac
。 headwidth
and shrink
( also in the docs ), especially if you want to make the head smaller too! headwidth
和shrink
( 也在文档中 ),特别是如果你想让头部更小!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.