With the following code I am plotting a candlestick graph and also make use of annotations. I have played arround until I found the right positions for the text, but I still don
You chose to have the text coordinates in offset points. E.g. xytext=(-17, 20)
places the text at 17
points to the left and 20
points to the top from the point which you annotate.
The coordinates may be more obvious when changing the horizontalalignment
to "center"
in the annotation. annotate( ... , ha="center")
.
You can then get the result by setting the x coordinate to 0
.
ax1.annotate('Long', xy=(stock_data['Date'][10], stock_data['Low'][10]),
xytext=(0, -27),
textcoords='offset points', ha="center",
arrowprops=dict(facecolor='grey', color='grey'))