Mplfinance: Question: axhspan support within mplfinance

Created on 18 Mar 2021  Â·  2Comments  Â·  Source: matplotlib/mplfinance

Hi Daniel,

Firstly, a massive thank you for putting this library out there! It has helped me a lot with an on-going project.

I was wondering if there is any way to have axhspan() functionality from matplotlib? Preferably without using external axis mode.

i.e.
image

question

All 2 comments

@daveydaid
Thanks for expressing your appreciation and for your interest in mplfinance.

There are two things that I would suggest, in order of preference:

  1. Use hlines kwarg: see the using lines tutorial, particularly cell number In [8] where something similar is done with vlines; just do the analogous thing with hlines.
  1. Without external axes mode, you can still gain access to the axes using returnfig=True. (See item number 1 on this page). The code might look something like this:
    python fig,axlist = mpf.plot(data,...,returnfig=True) axlist[0].axhspan(...) mpf.show()

HTH. All the best. --Daniel

Perfect thank you - No.2 sorted me right out!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

debjyotiarr picture debjyotiarr  Â·  3Comments

ismailbayram picture ismailbayram  Â·  4Comments

leochan007 picture leochan007  Â·  6Comments

schorschie picture schorschie  Â·  3Comments

jainraje picture jainraje  Â·  4Comments