Skip to content

Commit

Permalink
Bugfix: Time series display with +/- values < eps
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed May 5, 2020
1 parent 82c4b8e commit 972f601
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -5,7 +5,7 @@
<body alink="#fff000" link="#fff000" vlink="#fff000">
<h4><span style="font-family: Arial Black; color: #ffffff;"><strong>THERE IS NO UNDO BUTTON - SET UP A BACKUP OF YOUR DATABASE</strong></span></h4>
<HR>
<!-- LICENCE_START -->Version: 3.200504 (04-May-2020)<br>
<!-- LICENCE_START -->Version: 3.200505 (05-May-2020)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2020
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.200504 (04-May-2020)
% v. 3.200505 (05-May-2020)
22 changes: 11 additions & 11 deletions toolbox/gui/figure_timeseries.m
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 972f601

Please sign in to comment.