Reordering plots - LIMO-EEG-Toolbox/limo_tools GitHub Wiki
The default view shows results organized as per acquisition (channel), decomposition (IC) or reconstruction (sources). While useful, it is not always the most informative, and reordering per regions, hemispheres, etc. can be useful. This can be achieved quickly simply re-organizing 'results'.
The default 'view'
By default, the full brain analysis results will show you the channel/IC/source in the Y axis and time or frequency in the x axis.
Because the plotted results are available in the workspace, so there is no need to call functions manually to replot results. For instance, after an image all results using spatial-temporal clustering, the mask variable appear in the workspace. The plot is simply imagesc(stat_values.*(mask>0)
). Note I use mask>0 as mask it not binary, but reports the different clusters.
Current and new channel/IC/source order
- You need two vectors of labels, one corresponding to the current plotted data and one to the wanted order.
- Create in index of how to reorder the current vector to look like the wanted order.
- Plot applying the index to the variable returned in the workspace.
For instance, for channels, the current plot is
current_order = arrayfun(@(x)(x.labels), LIMO.data.chanlocs, 'UniformOutput', false);
Assuming you have created a vector wanted_order
of the labels, par instance split per hemisphere. Often in EEG this is a simple odd/even channel number so the wanted_order could be
wanted_order = [current_order(1:2:length(current_order)) current_order(2:2:length(current_order))];
Getting the index can be done in a simple loop such as:
for c=length(wanted_order):-1:1
reorder(c) = find(strcmpi(wanted_order{c},current_order));
end
Reploting is thus simply applying that new order, for instance:
imagesc(stat_values(reorder,:).*(mask>0)`
Replot
We can also use a little of the limo_tools magic to get better looking plots.
- as a simple figure
- using the full display
figure
load('my_anova_effect.mat')
F_values=Rep_ANOVA(:,:,1);
Display = F_values.*(mask>0);
imagesc(Display(reorder,:));
set(gca,'YTickLabel', wanted_order);
title('Results reordered');
Display(find(Display==0))=NaN;
colormap(limo_color_images(Display));
For the Wakeman and Henson (2015) main face effect, this gives the following difference between plots