-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotTimeSeries.m
34 lines (32 loc) · 1.01 KB
/
plotTimeSeries.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% This script makes time series plots for all channels during stim and during rest
figure('Position', [200, 200, 1200, 1200]);
subplot(1, 2, 1);
toplot = squeeze(mean(dataStim, 1))';
if strcmp(ref, 'car'), toplot(bad_chans, :) = nan; end
imagescNaN(t_trial, 1:nchannels, toplot, 'CLim', clim.EP);
xlim([0, 1]);
if strcmp(ref, 'car')
set(gca, 'YTick', 1:2:nchannels);
set(gca, 'YTickLabels', chNames(1:2:end));
elseif strcmp(ref, 'bipolar')
set(gca, 'YTick', 1:1:nchannels);
set(gca, 'YTickLabels', bipolarChans);
end
title('Stim');
ylabel('channels');
xlabel('time (s)');
colormap(cm);
subplot(1, 2, 2);
toplot = squeeze(mean(dataRest, 1))';
if strcmp(ref, 'car'), toplot(bad_chans, :) = nan; end
imagescNaN(t_trial, 1:nchannels, toplot, 'CLim', clim.EP);
xlim([0, 1]);
if strcmp(ref, 'car')
set(gca, 'YTick', 1:2:nchannels, 'YTickLabels', chNames(1:2:end));
elseif strcmp(ref, 'bipolar')
set(gca, 'YTick', 1:nchannels, 'YTickLabels', bipolarChans);
end
title('Rest');
xlabel('time (s)');
colormap(cm);
colorbar;