x = [0, 1]
y = [0, 0]
ax.plot(x, y)
dy = 5 / 72
i = 1
tmp = ax.transData.transform([(0, 0), (1, 1)])
tmp = tmp[1, i] - tmp[0, i]
tmp = 1 / tmp
tmp = tmp * dy * ax.get_figure().get_dpi()
ax.plot(x, y)
ax.annotate('', [0, tmp], [1, tmp], size=10, arrowprops=dict(arrowstyle=
    '<|-|>'))
plt.show()
How do I offset lines in matplotlib by X points