我试过下面的代码,但没用。。。 它说“raise AttributeError('未知属性%s'%k)” AttributeError:未知属性headwidth“。。。在
xyfrom=[10,620]
xyto=[130,620]
ax.annotate("",xyfrom,xyto,arrowprops=dict(arrowstyle='<->',linewidth = 2, headwidth=10,color = 'k'
))
ax.text((xyto[0]+xyfrom[0])/2-15,(xyto[1]+xyfrom[1])/2+10,"headwidth is too small",fontsize=24)
我相信这是因为你需要在一个字符串中给出你的arrowstyle参数。试试这个:
,请注意这是一个完整的字符串:
^{pr2}$在matplotlib中这是一个非常奇怪的选择,我真的不明白为什么要这样。不管怎样,看看能不能解决你的问题。在
相关问题 更多 >
编程相关推荐