Skip to content

Commit

Permalink
bugfix: timelimits were ignored for pvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
behinger committed Dec 6, 2017
1 parent de1ddd3 commit dbd7be3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions topo_butter/plot_butterfly.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

% Mark Single Channels
for ch = 1:size(plt.data,1)
sigConnected = bwlabel(sigTime(ch,:));
sigConnected = bwlabel(sigTime(ch,plt.timeidx));
for sigC = 1:max(sigConnected)
sigTimeIdx = find(sigConnected == sigC);
plot(plt.time(sigTimeIdx),plt.data(ch,sigTimeIdx),'k','LineWidth',1.5)
Expand All @@ -98,7 +98,7 @@

% Mark rectangular things in the background
sigAny = any(sigTime,1);
sigConnected = bwlabel(sigAny);
sigConnected = bwlabel(sigAny(plt.timeidx));

% We need to do this to get anything in the background in matlab
pvalAreaAxes = axes('Position',plot_pos,'XLim',get(plotAxes,'XLim'),'YLim',get(plotAxes,'YLim'));
Expand Down
12 changes: 7 additions & 5 deletions topo_butter/plot_topo.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'topoalpha','real',[],0.05; % change the statistical alpha-value indicating significant electrodes
'contour','string',{'yes','no'},'yes'; % activate/deactive contour
'individualcontour','string',{'yes','no'},'no'; % do not put the contour lines on the same value
'individualcolormap','string',{'yes','no'},'no'; % do not put the same caxis limit for all colormaps
'individualcolorscale','string',{'yes','row','no'},'no'; % do not put the same caxis limit for all colormaps
'colormap','cell',{},{'div'}; % customized colorbars are possible: {{'div','RdYlBu'},{'div','BrBG'},'seq'}. The whole set of colorbrewer is available
'n_rows','integer',[1 1:size(inp_data,3)],size(inp_data,3); % number of rows to be used, by default plots one row per third-dimension entry of EEG.data. But it is possible to skip some*
'numcontour','integer',[],6; % How many contour lines
Expand Down Expand Up @@ -133,8 +133,10 @@

if ~isempty(g.caxis)
scale = g.caxis;
else
scale = prctile(data(:),[1 99]);
elseif strcmp(g.individualcolorscale,'row')
scale = prctile(data(:),[1 99]);
elseif strcmp(g.individualcolorscale,'no')
scale = prctile(inp_data(:),[0.05 99.95]);
end

% make scale symmetric for divergent colormaps
Expand Down Expand Up @@ -195,8 +197,8 @@
set(topo_image,'YDir','normal');
axis(topo_image,'square','off')
set(h,'alphadata',~isnan(cdata))
switch g.individualcolormap
case 'no'
switch g.individualcolorscale
case {'row','no'}
caxis(topo_image,scale)
end
% Change the respective colormap
Expand Down

0 comments on commit dbd7be3

Please sign in to comment.