Custom arrow style for matplotlib, pyplot.annotate
问题 I am using matplotlib.pyplot.annotate to draw an arrow on my plot, like so: import matplotlib.pyplot as plt plt.annotate("",(x,ybottom),(x,ytop),arrowprops=dict(arrowstyle="->")) I want to use an arrow style that has a flat line at one end and an arrow at the other, so combining the styles "|-|" and "->" to make something we might call "|->", but I can't figure out how to define my own style. I thought I might try something like import matplotlib.patches as patches myarrow = patches