diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index 1cc63ba1b..d65e8c69d 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -274,9 +274,15 @@ def generate_profit_graph(pairs: str, tickers: Dict[str, pd.DataFrame], name='Avg close price', ) - fig = make_subplots(rows=3, cols=1, shared_xaxes=True, row_width=[1, 1, 1], - subplot_titles=["AVG Close Price", "Combined Profit", "Protit per pair"]) + fig = make_subplots(rows=3, cols=1, shared_xaxes=True, + row_width=[1, 1, 1], + vertical_spacing=0.05, + subplot_titles=["AVG Close Price", "Combined Profit", "Profit per pair"]) fig['layout'].update(title="Profit plot") + fig['layout']['yaxis1'].update(title='Price') + fig['layout']['yaxis2'].update(title='Profit') + fig['layout']['yaxis3'].update(title='Profit') + fig['layout']['xaxis']['rangeslider'].update(visible=False) fig.add_trace(avgclose, 1, 1) fig = add_profit(fig, 2, df_comb, 'cum_profit', 'Profit') diff --git a/freqtrade/tests/test_plotting.py b/freqtrade/tests/test_plotting.py index 9f53809d1..52ed6f3e7 100644 --- a/freqtrade/tests/test_plotting.py +++ b/freqtrade/tests/test_plotting.py @@ -259,6 +259,10 @@ def test_generate_profit_graph(): assert isinstance(fig, go.Figure) assert fig.layout.title.text == "Profit plot" + assert fig.layout.yaxis.title.text == "Price" + assert fig.layout.yaxis2.title.text == "Profit" + assert fig.layout.yaxis3.title.text == "Profit" + figure = fig.layout.figure assert len(figure.data) == 4