matplotlib / matplotlib/mplfinance
How to add Horizontal Line in make_addplot? make_addplot(rsi,panel='lower',color='g',hlines=[20,80])
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
I have this code.
```python
apds = [mpf.make_addplot(buy_signal,scatter=True,markersize=100,marker='^'),
mpf.make_addplot(sell_signal,scatter=True,markersize=100,marker='v'),
mpf.make_addplot(close_signal,scatter=True,markersize=100,marker='o'),
mpf.make_addplot(rsi,panel='lower',color='g',hlines=[20,80])
mpf.plot(self.df,addplot=apds,figscale=2,volume=False,type = type,
title= str(self.info)
)
```
I want to put a horizontal line for my RSI. But there is a kwargs error which says hline is not found.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the make_addplot entry point and how its keyword arguments are handled before mpf.plot renders the lower panel. Confirm how an RSI panel can receive horizontal levels at 20 and 80, then verify that the example runs without the unknown-kwarg error and displays both lines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100