Skip to content

vlines (vertical lines, sharing x axis) on multiple panels #513

@Tirbo06

Description

@Tirbo06

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) to mpf.plot() it is not drawing on all panels)

  • [2] : Adjusting the grid for x_axis with MPF. I seen other examples where we have to use axes . 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..)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions