Problem
When multiple data sources are overlaid via Plotter.compute(), there is no validation that they share the same coordinate or value units. HoloViews silently accepts an hv.Overlay of elements with inconsistent kdim/vdim units — Bokeh renders the axis using the first element's unit metadata while plotting all other elements' raw values unscaled.
This was exposed by #868: fixing the monitor histogram output to preserve the user-configured edge unit meant event-mode monitors (ev44) now correctly output ms coordinates, while some other monitors (e.g., da00 histogram-mode) may still produce ns. The overlay then mixes ms-scale values (0–71) with ns-scale values (0–71,000,000) on a single axis, making some curves appear collapsed near zero.
Affected scope
The bug is not limited to LinePlotter or to coordinate dimensions:
- Coordinate dimensions (X axis): Affected for
LinePlotter (the originally reported case). ImagePlotter and Overlay1DPlotter are technically affected too, though overlaying 2D images is unusual in practice. Overlay1DPlotter's internal overlay (slices of the same array) is safe, but the outer overlay in compute() is not.
- Value dimensions (Y axis for curves, colorbar for images): Same issue. If sources produce different value units (e.g.,
counts vs counts/s), the axis label shows the first element's unit while all others are plotted unscaled. BarsPlotter is also affected here (categorical kdim, but value units can mismatch).
The unit information flows through create_value_dimension and coord_to_dimension in scipp_to_holoviews.py — each element carries its own units, but the overlay never reconciles them.
Expected behavior
The plotter should either:
- Convert all data to a common unit before overlaying, or
- Raise a clear error on unit mismatch
Location
Plotter.compute() in src/ess/livedata/dashboard/plots.py — the hv.Overlay(plots) call at line 468 has no unit consistency check. The fix should go here, before the overlay is created, covering all plotter types.
Problem
When multiple data sources are overlaid via
Plotter.compute(), there is no validation that they share the same coordinate or value units. HoloViews silently accepts anhv.Overlayof elements with inconsistent kdim/vdim units — Bokeh renders the axis using the first element's unit metadata while plotting all other elements' raw values unscaled.This was exposed by #868: fixing the monitor histogram output to preserve the user-configured edge unit meant event-mode monitors (ev44) now correctly output
mscoordinates, while some other monitors (e.g., da00 histogram-mode) may still producens. The overlay then mixesms-scale values (0–71) withns-scale values (0–71,000,000) on a single axis, making some curves appear collapsed near zero.Affected scope
The bug is not limited to
LinePlotteror to coordinate dimensions:LinePlotter(the originally reported case).ImagePlotterandOverlay1DPlotterare technically affected too, though overlaying 2D images is unusual in practice.Overlay1DPlotter's internal overlay (slices of the same array) is safe, but the outer overlay incompute()is not.countsvscounts/s), the axis label shows the first element's unit while all others are plotted unscaled.BarsPlotteris also affected here (categorical kdim, but value units can mismatch).The unit information flows through
create_value_dimensionandcoord_to_dimensioninscipp_to_holoviews.py— each element carries its own units, but the overlay never reconciles them.Expected behavior
The plotter should either:
Location
Plotter.compute()insrc/ess/livedata/dashboard/plots.py— thehv.Overlay(plots)call at line 468 has no unit consistency check. The fix should go here, before the overlay is created, covering all plotter types.