ax.set_ylim([-2, 2])
ax.annotate('', xy=(4, 1), xytext=(6, 1), xycoords='data', textcoords=
    'data', arrowprops={'arrowstyle': '|-|'})
ax.annotate('important\npart', xy=(5, 1.5), ha='center', va='center')
How to annotate a range of the x axis in matplotlib?