-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPLoSdataplot.m
More file actions
172 lines (124 loc) · 3.75 KB
/
PLoSdataplot.m
File metadata and controls
172 lines (124 loc) · 3.75 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
function PLoSdataplot(S)
%%% PLOT THE DATA1SETS
F = 96485.3365; % C/mol
CVF = F*1e9; % Convert flux densities to nA
ik = S.Neurondata.jk*CVF;
ina = S.Neurondata.jna*CVF;
ica = S.Neurondata.jca*2*CVF;
ix = -S.Neurondata.jx*CVF;
icap = S.Neurondata.icap*1e9; %convert A to nA
imembt = S.Neurondata.imemb*1e9;
times = S.Neurondata.times*1000; %convert s to ms
iion = ik + ina + ica + ix; % nA
% total currents
inat = sum(ina,1); % summed over all depths, as fcn of time
ikt = sum(ik,1);
icat = sum(ica,1);
icapt = sum(icap,1);
ixt = sum(ix,1);
iiont = sum(iion,1);
imembtt = sum(imembt,1);
% time interval to plot:
tinterv = [0 7000];
tindexes = find(times>=tinterv(1) & times <=tinterv(2));
% compartments to plot
NN1 = 2; % soma
NN2 = 7; % trunk
NN3 = 12; % apical
% Note: Neuronal output for 13 compartments (size(ina) = #timepts x 13)
% Later we add a voxel on top and bottom to get 15 compartments
% Then e.g. soma is voxel 3.
h = figure; hold on;
myc = 'k';
set(gcf, 'Color', [1 1 1]);
set(gcf, 'Position', [21 141 1050 697]);
%%% PLOT SOMA
subplot(6,4,1)
plot(times(tindexes), ina(NN1,tindexes), myc);
subplot(6,4,5)
plot(times(tindexes),ik(NN1,tindexes), myc);
subplot(6,4,9)
plot(times(tindexes),ica(NN1, tindexes), myc);
subplot(6,4,13)
plot(times(tindexes),ix(NN1,tindexes), myc);
subplot(6,4,17)
plot(times(tindexes),icap(NN1,tindexes), myc);
subplot(6,4,21)
plot(times(tindexes),imembt(NN1,(tindexes)), myc);
xlabel('t(ms)', 'FontSize', 12);
%%% PLOT TRUNK
subplot(6,4,2)
plot(times(tindexes), ina(NN2,tindexes), myc);
subplot(6,4,6)
plot(times(tindexes),ik(NN2,tindexes), myc);
subplot(6,4,10)
plot(times(tindexes),ica(NN2, tindexes), myc);
subplot(6,4,14)
plot(times(tindexes),ix(NN2,tindexes), myc);
subplot(6,4,18)
plot(times(tindexes),icap(NN2,tindexes), myc);
subplot(6,4,22)
plot(times(tindexes),imembt(NN2,(tindexes)), myc);
xlabel('t(ms)', 'FontSize', 12);
%%% PLOT APICAL
subplot(6,4,3)
plot(times(tindexes), ina(NN3,tindexes), myc);
subplot(6,4,7)
plot(times(tindexes),ik(NN3,tindexes), myc);
subplot(6,4,11)
plot(times(tindexes),ica(NN3, tindexes), myc);
subplot(6,4,15)
plot(times(tindexes),ix(NN3,tindexes), myc);
subplot(6,4,19)
plot(times(tindexes),icap(NN3,tindexes), myc);
subplot(6,4,23)
plot(times(tindexes),imembt(NN3,(tindexes)), myc);
xlabel('t(ms)', 'FontSize', 12);
%%% PLOT TOTAL
subplot(6,4,4)
plot(times(tindexes), inat(tindexes), myc);
subplot(6,4,8)
plot(times(tindexes),ikt(tindexes), myc);
subplot(6,4,12)
plot(times(tindexes),icat(tindexes), myc);
subplot(6,4,16)
plot(times(tindexes),ixt(tindexes), myc);
subplot(6,4,20)
plot(times(tindexes),icapt(tindexes), myc);
subplot(6,4,24)
plot(times(tindexes),imembtt(tindexes), myc);
xlabel('t(ms)', 'FontSize', 12);
%%% Remove xticks
for i = 1:20
subplot(6,4,i);
set(gca, 'XtickLabel', '');
end
%%% Get right time-axes
for i = 1:24
subplot(6,4,i)
haxis = axis;
haxis(1) = tinterv(1); haxis(2) = tinterv(2);
axis(haxis);
end
%%% Insert titles
subplot(6,4,1); title('A Soma', 'FontSize',14)
subplot(6,4,2); title('B Trunk', 'FontSize',14)
subplot(6,4,3); title('C Apical', 'FontSize',14)
subplot(6,4,4); title('D Total', 'FontSize',14)
% Insert y-labels
subplot(6,4,1); ylabel('i_{Na}(nA)', 'FontSize', 12);
subplot(6,4,5); ylabel('i_K(nA)', 'FontSize', 12);
subplot(6,4,9); ylabel('i_{Ca}(nA)', 'FontSize', 12);
subplot(6,4,13); ylabel('i_X(nA)', 'FontSize', 12);
subplot(6,4,17); ylabel('i_{cap}(nA)', 'FontSize', 12);
subplot(6,4,21); ylabel('i_{tot}(nA)', 'FontSize', 12);
%%% Number rows
vstep = 1/7;
for i = 1:6
hhhh = uicontrol('Style','text');
set(hhhh, 'Units', 'Normalized', 'BackgroundColor', [1 1 1]);
strnr = num2str(i);
set(hhhh, 'String', strnr, 'Position', [0.04 0.87-vstep*(i-1) 0.03 0.05], 'Fontsize', 14);
end
%figure;
%plot(mean(isyn,2), 1:13)