-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_fluorescence_trace_and_ratio.m
63 lines (62 loc) · 2.21 KB
/
plot_fluorescence_trace_and_ratio.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function plot_fluorescence_trace_and_ratio(fluG, fluR, deltaR_R0, varargin)
figure
% various arguments in oder: curvature of head, fwd, bkw, turn
N = size(deltaR_R0, 1);
% odd column for red vs. green fluorescence
for i=1:N
subplot(N,2,2*i-1);
plot(fluR(i,:),'r','LineWidth',1.5);hold on;
plot(fluG(i,:),'g','LineWidth',1.5);
% determine how to plot: curvature, movement status
if nargin==4 % curvature
curv=varargin{1};
yyaxis right
plot(curv,'k--','LineWidth',1.5);
plot(zeros(length(curv),1),'k:','LineWidth',1.5);
elseif nargin==6 % movement status
fwd=varargin{1};
bkw=varargin{2};
turn=varargin{3};
shadow_movement_status(fwd,bkw,turn);
elseif nargin==7 % cuvr & movement status
curv=varargin{1};
fwd=varargin{2};
bkw=varargin{3};
turn=varargin{4};
yyaxis right
plot(curv,'k--','LineWidth',1.5);
plot(zeros(length(curv),1),'k:','LineWidth',1.5);
yyaxis left
shadow_movement_status(fwd,bkw,turn);
end
title(['neuron ' num2str(i)]);
end
for i=1:N
subplot(N,2,2*i);
plot(deltaR_R0(i,:),'b','LineWidth',1.5);hold on;
plot(zeros(length(deltaR_R0(i,:)),1),'b:','LineWidth',1.5);
% determine how to plot: curvature, movement status
if nargin==4 % curvature
curv=varargin{1};
yyaxis right
plot(curv,'k--');
plot(zeros(length(curv),1),'k:','LineWidth',1.5);
elseif nargin==6 % movement status
fwd=varargin{1};
bkw=varargin{2};
turn=varargin{3};
shadow_movement_status(fwd,bkw,turn);
elseif nargin==7 % cuvr & movement status
curv=varargin{1};
fwd=varargin{2};
bkw=varargin{3};
turn=varargin{4};
yyaxis right
plot(curv,'k--','LineWidth',1.5);
plot(zeros(length(curv),1),'k:','LineWidth',1.5);
yyaxis left
shadow_movement_status(fwd,bkw,turn);
end
title(['neuron ' num2str(i)]);
end
end