1

How can I display letters or numbers on each candle stick on mplfinance? For example, I want to show 0 (for green bars) and 1 (for red bars) on top of each candle stick, instead of marks.

Ruli
  • 2,592
  • 12
  • 30
  • 40
Steven
  • 21
  • 2

1 Answers1

1

There are a number of ways to do this. You can do it with Axes.text() or with Axes.annotate() as noted in these examples:

However, probably the easiest solution is to use mpf.make_addplot() to create a type=scatter plot where you want the numbers to appear, and then pass in a sequence of markers for the marker= kwarg (of make_addplot), and use Mathtext markers for the markers (for example "$1$" is a '1', etc.)

Click here for example code.


Other discussions that may be worth reading through:

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61