mplfinance icon indicating copy to clipboard operation
mplfinance copied to clipboard

Line name in hlines

Open nsharov opened this issue 5 years ago • 1 comments

Hello there!

@DanielGoldfarb , first of all, I wanted to thank you for the work done. it is very pleasant to use your module in work.

I recently started looking into the matplotlib and mplfinance packages, so I often run into problems that get resolved pretty quickly (thanks google).

Unfortunately, I could not think of or find a solution to the following problem: I am building a graph, on this graph I display n lines, I would like to name each of these lines, or indicate their value on the y-axis. image

As a result, I really want to get something like this: image

p.s. Sorry if there are errors somewhere in the text (I used google translate)

nsharov avatar Sep 17 '20 00:09 nsharov

@nsharov Thank you for expressing your appreciation for mplfinance.

I think I can point you in the correct direction to be able to find a way to do this.

There are a few different things you can try, all of which involve first gaining access to the Axes objects. Then you can either use Axes.set_yticks(), or use text and/or annonations on the appropriate Axes object.

To gain access to the Axes objects, you can either use returnfig=True, or create your own Figure and Axes using external Axes mode.

I recommend first trying returnfig=True.
It will keeps things simpler.

You can find more detail on these suggestions in the following links (and in the links within them) ...

  • https://github.com/matplotlib/mplfinance/issues/123#issuecomment-623979837
  • https://github.com/matplotlib/mplfinance/issues/219#issuecomment-671292326
  • https://github.com/matplotlib/mplfinance/issues/181#issuecomment-667252575

All the best. Please let me know how it works out.

DanielGoldfarb avatar Sep 18 '20 01:09 DanielGoldfarb