如果要使用箭头/箭头功能之一绘制箭头而不是轴线,如何显示线/箭头?下面的例子:
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什么也没画,而plt.arrow画一条线但没有箭头。
最佳答案
plt.arrow(0,0,0,1, shape='full', lw=3, length_includes_head=True, head_width=.01)
关于matplotlib - 如何在matplotlib中使用pyplot.arrow或patchs.Arrow?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7947532/