Skip to content

Commit

Permalink
Bugfix: PSD display of one frequency point in band
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Cousineau committed Oct 5, 2018
1 parent 88f4c2f commit 5ad7288
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion toolbox/gui/figure_spectrum.m
Expand Up @@ -1018,11 +1018,16 @@ function UpdateFigurePlot(hFig, isForced)
% Case of one frequency point for spectrum: replicate frequency
if isSpectrum && (size(TF,3) == 1)
TF = cat(3,TF,TF);
X = [X, X + 0.1];
replicateFreq = 1;
else
replicateFreq = 0;
end
% Bands (time/freq), or linear axes
if iscell(X)
Xbands = process_tf_bands('GetBounds', X);
if replicateFreq
Xbands(:, end) = Xbands(:, end) + 0.1;
end
if (size(Xbands,1) == 1)
X = Xbands;
XLim = Xbands;
Expand All @@ -1031,6 +1036,9 @@ function UpdateFigurePlot(hFig, isForced)
XLim = [min(Xbands(:)), max(Xbands(:))];
end
else
if replicateFreq
X = [X, X + 0.1];
end
XLim = [X(1), X(end)];
end
if (length(XLim) ~= 2) || any(isnan(XLim)) || (XLim(2) <= XLim(1))
Expand Down

0 comments on commit 5ad7288

Please sign in to comment.