如何指定箭头的坐标

18 浏览
0 Comments

如何指定箭头的坐标

我试图在matplotlib中根据这个例子(http://matplotlib.org/examples/pylab_examples/arrow_simple_demo.html)将箭头从(0.1,0.5)绘制到(0.5,0.5):

f = plt.figure()
ax = plt.subplot(2, 1, 1)
plt.xlim([0, 1])
plt.ylim([0, 1])
ax.arrow(0.1, 0.5, 0.5, 0.5,
         head_width=0.05,
         head_length=0.1,
         fc='k',
         ec='k',
         clip_on=False)
plt.show()

这应该产生一个水平的箭头,但由于某种原因它给出了一个倾斜的箭头,而不是以(0.5,0.5)结束。这里有什么问题?

0