matplotlib / matplotlib/mplfinance

Support `fill_between` in "External Axes" Mode. And Support multiple `fill_between`s

Open
#291 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
in "External Axes Method", the 'fill_between' function does not work.

**To Reproduce**
`import mplfinance as mpf
idf = pd.read_csv('data/SPY_20110701_20120630_Bollinger.csv',index_col=0,parse_dates=True)

fig = mpf.figure(style='yahoo',figsize=(7,8))

ax1 = fig.add_subplot(2,1,1)

ax2 = fig.add_subplot(2,1,2)

mpf.plot(idf,ax=ax1,volume=ax2,fill_between=130)
`

**Expected behavior**
An candlestick plot with shaded region at prices 0-130.

**Screenshots**
![Figure 2020-11-11 222511](https://user-images.githubusercontent.com/67168896/98891803-f3c87280-246c-11eb-8e37-12ed726dfc4c.png)

**Desktop (please complete the following information):**
- OS: Windows 10, python 3.8, Spyder

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python reproduction with the SPY Bollinger CSV and inspect how external axes are handled alongside the fill_between option. Done means the shaded 0–130 region appears in external-axes mode and multiple fill_between specifications are supported without breaking the candlestick plot.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.