From 644676e661f2312f5262c49e1e3bb8a201a1c0d9 Mon Sep 17 00:00:00 2001 From: Sam Scholten Date: Thu, 30 Oct 2025 15:18:35 +1000 Subject: Fix: Ensure axis time unit label is correct after initial render The x-axis label was using the time unit calculated from the entire data span, but after render() the optimal unit is recalculated based on the actual view span. Add explicit call to _update_axis_formatting() after _update_plot_data() to ensure the label reflects the correct time unit for the displayed view. --- pyproject.toml | 2 +- src/scopekit/plot.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4877e93..8daf02f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scopekit" -version = "1.0.4" +version = "1.0.5" description = "General-purpose oscilloscope plotting components." authors = [{ name = "Sam Scholten", email = "s.scholten@uq.edu.au" }] requires-python = ">=3.8" diff --git a/src/scopekit/plot.py b/src/scopekit/plot.py index f405432..0b96722 100644 --- a/src/scopekit/plot.py +++ b/src/scopekit/plot.py @@ -1549,6 +1549,7 @@ class OscilloscopePlot: # This will also update the legend and regions self.state.set_updating(False) # Ensure not in updating state for first call self._update_plot_data(self.ax) + self._update_axis_formatting() self.fig.canvas.draw_idle() print("Plot rendering complete.") -- cgit v1.2.3