我正在使用annotate
在matplotlib
中绘制一个箭头。我想把箭再肥一点。我想要的效果是一个带有细边线的双头箭头,在这里我可以控制箭头的宽度,即不改变linewidth
。我在this答案后尝试了kwargs
,例如width
,但这导致了一个错误,我也尝试了arrowstyle
和{
到目前为止,我的代码是:
import matplotlib.pyplot as plt
plt.figure(figsize=(5, 5))
plt.annotate('', xy=(.2, .2), xycoords='data',
xytext=(.8, .8), textcoords='data',
arrowprops=dict(arrowstyle='<|-|>',
facecolor='w',
edgecolor='k', lw=1))
plt.show()
我使用的是python2.7和Matplotlib 1.5.1
最简单的方法是使用^{} 和darrow(双箭头)选项。这种方法的一个棘手的部分是箭头不会围绕其尖端旋转,而是围绕定义箭头主体的矩形的边缘旋转。我用一个红点在旋转位置演示。在
给予:
相关问题 更多 >
编程相关推荐