/
plotEyelidTraces.m
32 lines (31 loc) · 1.19 KB
/
plotEyelidTraces.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
%%% expects the following variables:
%%% timeVector a vector containing timestamp for each bin in the
%%% eyetraces
%%% traces a n mice x 200 x 4 array; each row is the FEC values
%%% for each bin for the average eyetrace for a mouse; each
%%% z-dimensional value contains traces for a single day
%%% color the color that you want the lines to be
%%% ymax maximum y limit
function [A,B,C,D]=plotEyelidTraces(timeVector, traces, color, ymax)
plot([0.2 0.2], [0 0.8], 'Color', [0 0 0])
hold on
for d = 1:4
switch d
case 1
A = plot(timeVector, nanmean(traces(:,:,d)), 'Color', color);
case 2
B = plot(timeVector, nanmean(traces(:,:,d)), 'Color', color, ...
'LineStyle', '-.');
case 3
C = plot(timeVector, nanmean(traces(:,:,d)), 'Color', color, ...
'LineStyle', '--');
case 4
D = plot(timeVector, nanmean(traces(:,:,d)), 'Color', color, ...
'LineStyle', ':');
end
end
ylim([0 ymax])
xlim([0 0.25])
set(gca, 'box', 'off', 'TickDir', 'out')
xlabel('Time from Tone (s)')
end