matplotlib / matplotlib/mplfinance
`vlines` (vertical lines, sharing x axis) on multiple panels
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
Hello Daniel, 👋
Thank you for your dedication in improving the MPF library ! 📈
I am looking for different options for the X_AXIS/GRID adjustments:
-
[1] : Drawing vertical line for all panels ( when passing
**kwargs(vlines)tompf.plot()it is not drawing on all panels) -
[2] : Adjusting the
gridforx_axiswith MPF. I seen other examples where we have to useaxes. Is there a more efficient way to do that with MPF?
If i well understood what others did is, returning the axes and then calling the add_subplot method from MPL wich will force me to start again from scratch using only MPL.
I guess I missed something, here is a part of my code:
df = 'pandas dataframe with datetime index and ohlcv and RSI values'
vls = pd.date_range(df.index.min(), df.index.max(), freq='D').tolist()
ap1 = [
mpf.make_addplot(df['RSI'], panel=1, color='royalblue')
]
kwargs = dict(type='candle', vlines=dict(vlines=vls, linewidths=0.5, colors=('r')))
mpf.plot(df, addplot=ap1, **kwargs)
(If you prefer 2 different posts i can separate each request..)
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 from the provided mpf.plot() example using addplot, vlines, and a pandas datetime index, then inspect how vertical lines and x-axis grid settings are applied across panels. Done means vertical lines appear on all panels and the x-axis grid can be adjusted through MPF without rebuilding the chart with Matplotlib.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, pandas, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100