how to use pyplot.arrow or patches.Arrow in matplo

2020-07-06 03:50发布

If I wanted to draw arrows instead of axis lines using one of the arrow/Arrow functions, how do I get the line/arrowhead to show up? Example below:

import matplotlib.pyplot as plt
import matplotlib.patches as pts

plt.ion()
ax = plt.axes()
ax.set(xlim=[0,1],ylim=[0,1],autoscale_on=False,clip_on=False)
ax.set(frame_on=False,xticks=[],yticks=[])
pts.Arrow(0,0,1,0,width=0.05)
plt.arrow(0,0,0,1,shape='right',lw=3,fill=True)
ax.text(1,0,'functionalization',
        verticalalignment='top',
        horizontalalignment='center')
ax.text(0,1,'void space/structure')
plt.draw()

pts.Arrow draws nothing, and plt.arrow draws a line but no arrowhead.

标签: matplotlib
1条回答
家丑人穷心不美
2楼-- · 2020-07-06 04:13
plt.arrow(0,0,0,1, shape='full', lw=3, length_includes_head=True, head_width=.01)
查看更多
登录 后发表回答