-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContoursNeuPlotPSTH.m
More file actions
88 lines (78 loc) · 2.27 KB
/
ContoursNeuPlotPSTH.m
File metadata and controls
88 lines (78 loc) · 2.27 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
function ContoursNeuPlotPSTH(psth,cluster,target,argcatch)
%ContoursNeuPlotPSTH Plot PSTH according to salience
%conditions
% ContoursNeuPlotPSTH(PSTH,cluster,target,catch) where
% TARGET is either 'contour' for the contour target, or 'control'
% for the control target. CATCH is either 'catch', which means to
% plot the response to the catch trials, or 'nocatch' which means
% not to plot the response to the catch trials.
if strcmp(argcatch,'catch')
plotcatch = 1;
elseif strcmp(argcatch,'nocatch')
plotcatch = 0;
elseif strcmp(argcatch,'allcatch')
plotcatch = 2;
end
% clear the current figure
clf
saliencesteps = size(psth.contour,2);
if plotcatch>0
numplots = saliencesteps + 1;
else
numplots = saliencesteps;
end
maxaxis = 0;
if strcmp(target,'contour')
% plot contour conditions
for si=1:saliencesteps
subplot(numplots,1,numplots-si+1),bar(psth.timebins,psth.contour(si).cluster(cluster).psth)
% get axis values
axi = axis;
% find max axis value so we can plot everything on the same scale
if axi(4)>maxaxis
maxaxis = axi(4);
end
end
if plotcatch==1
subplot(numplots,1,1),bar(psth.timebins,psth.catchcontour.cluster(cluster).psth)
% get axis values
axi = axis;
% find max axis value so we can plot everything on the same scale
if axi(4)>maxaxis
maxaxis = axi(4);
end
end
elseif strcmp(target,'control')
% plot control conditions
for si=1:saliencesteps
subplot(numplots,1,numplots-si+1),bar(psth.timebins,psth.control(si).cluster(cluster).psth)
% get axis values
axi = axis;
% find max axis value so we can plot everything on the same scale
if axi(4)>maxaxis
maxaxis = axi(4);
end
end
if plotcatch==1
subplot(numplots,1,1),bar(psth.timebins,psth.catchcontrol.cluster(cluster).psth)
% get axis values
axi = axis;
% find max axis value so we can plot everything on the same scale
if axi(4)>maxaxis
maxaxis = axi(4);
end
end
end
if plotcatch==2
subplot(numplots,1,1),bar(psth.timebins,psth.allcatch.cluster(cluster).psth)
% get axis values
axi = axis;
% find max axis value so we can plot everything on the same scale
if axi(4)>maxaxis
maxaxis = axi(4);
end
end
% make sure all plots have the same scale
for i=1:numplots
subplot(numplots,1,i),axis([axi(1) axi(2) axi(3) maxaxis])
end