-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_spike.m
71 lines (52 loc) · 1.84 KB
/
plot_spike.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
64
65
66
67
68
69
%%
%load combined_dataset1.mat
clear
close all
dataset=1;
%L=load(['./dataset' num2str(dataset) '/data_trial1.mat']);
L1=load('data_spike/combined_dataset01.mat');
L2=load('data_diffapprox/para_search_current');
D=[1 7]; %subplot dimension %BUG for D=[1 8+]???
m=length(L1.Ae)*length(L1.Ai);
figure
[pos,H,W]=subplotmod(D,1);
close all
figure
a = 120; %conversion factor from natural units to pixel
set(gcf,'position',[100 100 a*W a*H],'color','w')
for trial=1:m
[i,j]=ind2sub([length(L1.Ae) length(L1.Ai)],trial);
if L1.meanR(i,j)<60 && L1.meanR(i,j)>0.01%only plot if mean firing rate is reasonable
clc
load(['./data_spike/dataset' num2str(dataset,'%02u') '/data_trial' num2str(trial,'%03u') '.mat'],'Spk');
subplot(D(1),D(2),1)
imagesc(L1.Ai,L1.Ae,L1.meanR);
hold on
plot(L1.Ai(j),L1.Ae(i),'.g','markersize',20)
hold off
xlabel('a_i');ylabel('a_e');
subplotmod(D,1);
subplot(D(1),D(2),2)
imagesc(L2.ai,L2.ae,L2.maxR,[0 40]);
%axis([Ai(1) Ai(end) Ae(1) Ae(end)])
hold on
plot(L2.ai(j),L2.ae(i),'.g','markersize',20)
hold off
set(gca,'ytick',[]);
subplotmod(D,2);
subplot(D(1),D(2),3)
plot(Spk(:,1),Spk(:,2),'.',[1 1],[-pi pi],'r','linewidth',2)
xlim([0 5]) %limit to T<5 s otherwise too many points - can't see!
ylim([-pi pi])
title(['trial = ' num2str(trial) ', meanR = ' num2str(L1.meanR(i,j)) ' Hz, CV=' ...
num2str(L1.CV(i,j)) ', ae = ' num2str(L1.Ae(i)) ', ai = ' num2str(L1.Ai(j))])
[pos,H,W]=subplotmod(D,3);
set(gca,'position',axiscrd([pos(1)+0.2 pos(2)+0.2 0.6 5.8],H,W)); %subplot across multiple fields
xlabel('t (s)')
ylabel('x');
pause
%subplot(1,2,2)
title('Loading... Please wait...');%set(gca,'position',[h/w 0.25 (w-1.2*h)/w 0.5])
drawnow
end
end