diff --git a/Software/PC_Application/Traces/tracexyplot.cpp b/Software/PC_Application/Traces/tracexyplot.cpp index 56f6e75..37f540a 100644 --- a/Software/PC_Application/Traces/tracexyplot.cpp +++ b/Software/PC_Application/Traces/tracexyplot.cpp @@ -740,10 +740,14 @@ void TraceXYPlot::updateAxisTicks() min -= range * 0.05; max += range * 0.05; } - YAxis[i].rangeMin = min; - YAxis[i].rangeMax = max; - YAxis[i].rangeDiv = createAutomaticTicks(YAxis[i].ticks, min, max, 8); + } else { + // max/min still at default values, no valid samples are available for this axis, use default range + max = 1.0; + min = -1.0; } + YAxis[i].rangeMin = min; + YAxis[i].rangeMax = max; + YAxis[i].rangeDiv = createAutomaticTicks(YAxis[i].ticks, min, max, 8); } } }