From 570d43643c06179f1899ce3fc1e3accdbafb7cf4 Mon Sep 17 00:00:00 2001 From: Li Baoming <1508269885@qq.com> Date: Tue, 17 Mar 2026 16:23:09 +0800 Subject: [PATCH] fix: y-axi starts from zero --- dashboard/utils/training_plots.py | 4 ++++ dashboard/utils/visualizations.py | 1 + 2 files changed, 5 insertions(+) diff --git a/dashboard/utils/training_plots.py b/dashboard/utils/training_plots.py index a49453b..b22cc5d 100644 --- a/dashboard/utils/training_plots.py +++ b/dashboard/utils/training_plots.py @@ -76,6 +76,8 @@ def plot_single_metric(run, metric_key, title, ylabel, unit, smoothing, y_log): if y_log: fig.update_yaxes(type="log") + else: + fig.update_yaxes(rangemode="tozero") st.plotly_chart(fig, use_container_width=True) @@ -131,6 +133,8 @@ def plot_multi_metric_comparison( if y_log: fig.update_yaxes(type="log") + else: + fig.update_yaxes(rangemode="tozero") st.plotly_chart(fig, use_container_width=True) diff --git a/dashboard/utils/visualizations.py b/dashboard/utils/visualizations.py index 9846809..5e396c7 100644 --- a/dashboard/utils/visualizations.py +++ b/dashboard/utils/visualizations.py @@ -350,6 +350,7 @@ def plot_timeseries_auto( height=420, hovermode="x unified", ) + fig.update_yaxes(rangemode="tozero") if y_log_scale: fig.update_yaxes(type="log") return fig