Reputation: 3786
I am trying to "annotate" a candlestick chart with matplotlib, but I'm having a hard time finding the coordinates for each candle in order to annotate. For example I would like to write a number above or below a particular candle ..
Any idea on how to proceed ?
thanks !
Upvotes: 1
Views: 1198
Reputation: 21839
It would be better if you at least gave some indication which approaches you have already tried. If we take the example in the documentation http://matplotlib.sourceforge.net/examples/pylab_examples/finance_demo.html and add the line:
import datetime
dt = datetime.datetime(2004, 3, 8)
ax.annotate('A bad day at the office', xy=(dt, 24), xytext=(dt, 25),
arrowprops=dict(facecolor='black', shrink=0.05),
)
Just before the show, does that achieve what you are asking?
Upvotes: 2