From 972f60129c778a5fc7b9e6d7a7a40e207a80f3bb Mon Sep 17 00:00:00 2001 From: ftadel Date: Tue, 5 May 2020 15:35:22 +0200 Subject: [PATCH] Bugfix: Time series display with +/- values < eps --- doc/license.html | 2 +- doc/version.txt | 2 +- toolbox/gui/figure_timeseries.m | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/license.html b/doc/license.html index 73f057807..c83837618 100644 --- a/doc/license.html +++ b/doc/license.html @@ -5,7 +5,7 @@

THERE IS NO UNDO BUTTON - SET UP A BACKUP OF YOUR DATABASE


-Version: 3.200504 (04-May-2020)
+Version: 3.200505 (05-May-2020)
COPYRIGHT © 2000-2020 USC & McGill University.
diff --git a/doc/version.txt b/doc/version.txt index 5504e14c3..04be40fdd 100644 --- a/doc/version.txt +++ b/doc/version.txt @@ -1,2 +1,2 @@ % Brainstorm -% v. 3.200504 (04-May-2020) \ No newline at end of file +% v. 3.200505 (05-May-2020) \ No newline at end of file diff --git a/toolbox/gui/figure_timeseries.m b/toolbox/gui/figure_timeseries.m index ce56b2781..62bd7fb73 100644 --- a/toolbox/gui/figure_timeseries.m +++ b/toolbox/gui/figure_timeseries.m @@ -264,13 +264,13 @@ function UniformizeTimeSeriesScales(isUniform) hAxes = sFigure.Handles(iPlot).hAxes; % Get maximal value fmax = max(abs(FigureDataMinMax{iMod})) * sFigure.Handles(iPlot).DisplayFactor; - % If displaying absolute values (only positive values) - if (FigureDataMinMax{iMod}(1) >= 0) - ylim = 1.05 .* [0, fmax]; - % Else : displaying positive and negative values - else + % If displaying positive and negative values + if (FigureDataMinMax{iMod}(1) < -eps) || ((FigureDataMinMax{iMod}(1) < 0) && (FigureDataMinMax{iMod}(2) <= eps)) ylim = 1.05 .* [-fmax, fmax]; - end + % Else: displaying absolute values (only positive values) + else + ylim = 1.05 .* [0, fmax]; + end % Update figure Y-axis limits set(hAxes, 'YLim', ylim); setappdata(hAxes, 'YLimInit', ylim); @@ -3338,12 +3338,12 @@ function SetTimeVisible(hFig, isVisible) %#ok<*DEFNU> PlotHandles.DisplayUnits = fUnits; % Get automatic YLim if (Fmax ~= 0) - % If data to plot are absolute values - if (PlotHandles.DataMinMax(1) >= -eps) - YLim = 1.05 * PlotHandles.DisplayFactor * [0, Fmax]; - % Else, there are positive and negative values - else + % If data to plot are relative values + if (PlotHandles.DataMinMax(1) < -eps) || ((PlotHandles.DataMinMax(1) < 0) && (PlotHandles.DataMinMax(2) <= eps)) YLim = 1.05 * PlotHandles.DisplayFactor * [-Fmax, Fmax]; + % Otherwise: absolute values + else + YLim = 1.05 * PlotHandles.DisplayFactor * [0, Fmax]; end else YLim = [-1, 1];