我想分开我的面板,因为标题重叠。ADX 标题在 RSI 面板中。我试过了,tight_layout=True
但还是一样。
我的代码:
ap0 = [
mpf.make_addplot(df['sma_200'],color='#FF0000', panel=2),
mpf.make_addplot(df['sma_50'],color='#ffa500', panel=2),
mpf.make_addplot(df['sma_20'],color='#00FF00', panel=2),
mpf.make_addplot(df['rsi'],color='#ffa500', panel=0, title="RSI"),
mpf.make_addplot(df['hline_30'], panel=0),
mpf.make_addplot(df['hline_70'], panel=0),
mpf.make_addplot(df['adx'],color='#0000FF', panel=1, secondary_y=False, title="ADX"),
mpf.make_addplot(df['-di'],color='#FF0000', panel=1, secondary_y=False),
mpf.make_addplot(df['+di'],color='#32cd32', panel=1, secondary_y=False),
mpf.make_addplot(df['hline_25'], panel=1, secondary_y=False)
]
fig, axlist = mpf.plot(
df,
panel_ratios=(.05, .05, .2, .05),
type="hollow_candle",
yscale='log',
volume=True,
title="{} - {}".format(ticker, interval),
style=mpf_style,
figsize=(12.8, 10),
returnfig=True,
closefig=True,
addplot=ap0,
main_panel=2,
volume_panel=3,
num_panels=4,
)