diff --git a/lib/chainsync/bin/streamlit/Dashboard.py b/lib/chainsync/bin/streamlit/Dashboard.py index 784ad4c29..73d1c8a68 100644 --- a/lib/chainsync/bin/streamlit/Dashboard.py +++ b/lib/chainsync/bin/streamlit/Dashboard.py @@ -54,9 +54,7 @@ main_placeholder = st.empty() main_fig = mpf.figure(style="mike", figsize=(15, 15)) -ax_ohlcv = main_fig.add_subplot(3, 1, 1) -ax_fixed_rate = main_fig.add_subplot(3, 1, 2) -ax_positions = main_fig.add_subplot(3, 1, 3) +(ax_ohlcv, ax_fixed_rate, ax_positions) = main_fig.subplots(3, 1, sharex=True) while True: # Wallet addr to username mapping diff --git a/lib/chainsync/bin/streamlit/pages/Wallet_Stats.py b/lib/chainsync/bin/streamlit/pages/Wallet_Stats.py index f67079cae..9e854bc43 100644 --- a/lib/chainsync/bin/streamlit/pages/Wallet_Stats.py +++ b/lib/chainsync/bin/streamlit/pages/Wallet_Stats.py @@ -90,12 +90,7 @@ # Plot pnl over time main_fig = mpf.figure(style="mike", figsize=(15, 15)) -ax_pnl = main_fig.add_subplot(6, 1, 1) -ax_base = main_fig.add_subplot(6, 1, 2) -ax_long = main_fig.add_subplot(6, 1, 3) -ax_short = main_fig.add_subplot(6, 1, 4) -ax_lp = main_fig.add_subplot(6, 1, 5) -ax_withdraw = main_fig.add_subplot(6, 1, 6) +(ax_pnl, ax_base, ax_long, ax_short, ax_lp, ax_withdraw) = main_fig.subplots(6, 1, sharex=True) for addr in pnl_over_time["walletAddress"].unique(): format_name = user_lookup.set_index("address").loc[addr]["format_name"] diff --git a/lib/chainsync/chainsync/dashboard/plot_ohlcv.py b/lib/chainsync/chainsync/dashboard/plot_ohlcv.py index bc82104d9..edafc1995 100644 --- a/lib/chainsync/chainsync/dashboard/plot_ohlcv.py +++ b/lib/chainsync/chainsync/dashboard/plot_ohlcv.py @@ -8,7 +8,7 @@ def plot_ohlcv(ohlcv, ohlcv_ax): """Plots the ohlcv plot""" if len(ohlcv > 0): - mpf.plot(ohlcv, type="candle", ax=ohlcv_ax) + mpf.plot(ohlcv, type="candle", ax=ohlcv_ax, show_nontrading=True) ohlcv_ax.yaxis.set_major_formatter(mpl_ticker.FuncFormatter(lambda x, p: format(x, "0.6"))) ohlcv_ax.set_xlabel("block timestamp")