-
Notifications
You must be signed in to change notification settings - Fork 5
/
plotEBC.m
86 lines (73 loc) · 2.62 KB
/
plotEBC.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
function plotEBC(root,out,fign)
%% occupancy circular
figure(fign); subplot(1,4,1);
% the +pi/2 brings "forwards" to "up"
[t2, r2] = meshgrid(wrapTo2Pi(out.params.thetaBins+pi/2), out.params.distanceBins(1:end-1));
[x, y] = pol2cart(t2,r2);
surface(x,y, out.occ), shading interp
hold on
set(gca,'XTick',[],'YTick',[])
colormap(parula)
set(gca, 'YDir','Normal','CLim',[0 prctile(out.occ(:),99)])
set(gca,'YDir','Normal')
title('occ')
% colorbar
axis off; axis square
%% nspk circular
figure(fign); subplot(1,4,2);
% the +pi/2 brings "forwards" to "up"
[t2, r2] = meshgrid(wrapTo2Pi(out.params.thetaBins+pi/2), out.params.distanceBins(1:end-1));
[x, y] = pol2cart(t2,r2);
surface(x,y, out.nspk), shading interp
hold on
set(gca,'XTick',[],'YTick',[])
title([])
colormap(parula)
set(gca, 'YDir','Normal','CLim',[0 prctile(out.nspk(:),99)])
set(gca,'YDir','Normal')
title('nspk')
% colorbar
axis off; axis square
%% ratemap circular
figure(fign); subplot(1,4,3);
% the +pi/2 brings "forwards" to "up"
[t2, r2] = meshgrid(wrapTo2Pi(out.params.thetaBins+pi/2), out.params.distanceBins(1:end-1));
[x, y] = pol2cart(t2,r2);
h=surface(x,y, out.rm); shading interp
hold on
set(gca,'XTick',[],'YTick',[])
colormap(parula)
set(gca, 'YDir','Normal','CLim',[0 prctile(out.rm(:), 99)])
set(gca,'YDir','Normal')
title('rm')
axis off
title(prctile(out.rm(:), 99))
% colorbar
axis off; axis square
%% scatter of spike directions
figure(fign); ax = subplot(1,4,4); hold on;
if strcmp(class(root), 'CMBHOME.Session')
import CMBHOME.Utils.ContinuizeEpochs
plot(ContinuizeEpochs(root.x),ContinuizeEpochs(root.y),'Color',[.7 .7 .7])
colormap(ax,hsv)
xlim([min(ContinuizeEpochs(root.x)) max(ContinuizeEpochs(root.x))]);
ylim([min(ContinuizeEpochs(root.y)) max(ContinuizeEpochs(root.y))]);
cx = ContinuizeEpochs(root.cel_x);
cy = ContinuizeEpochs(root.cel_y);
ch = ContinuizeEpochs(root.cel_headdir);
scatter(cx,cy,15,ch,'filled')
else
plot(root.x,root.y,'Color',[.7 .7 .7])
colormap(ax,hsv)
xlim([min(root.x) max(root.x)]); ylim([min(root.y) max(root.y)])
cx = root.x(root.spike == 1);
cy = root.y(root.spike == 1);
ch = root.md(root.spike == 1);
scatter(cx,cy,15,ch,'filled')
end
scatter(out.QP(:,1),out.QP(:,2),30,'k','filled')
set(gca,'YDir','Normal')
title('Trajectory')
axis off
axis square
end