-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbml_plot_rasterSpeechTaskRT.m
More file actions
37 lines (30 loc) · 1.71 KB
/
bml_plot_rasterSpeechTaskRT.m
File metadata and controls
37 lines (30 loc) · 1.71 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
function [ fh ] = bml_plot_rasterSpeechTaskRT( figdir, figtitle, Stim, RT, SpDur, ntrials )
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
%respWind = round(respInterval(1)*spkSampRate):round(respInterval(2)*spkSampRate);
plott = linspace(Stim.respInterval(1),Stim.respInterval(2),size(Stim.DD,2));
[fh, rasterh, meanh, ~, ~] = makeRasterIFRplot(figtitle);
plotRastersandIFRs(plott, meanh, Stim.meanifr, Stim.stdifr, rasterh, Stim.DD, 0, [0 0 0]);
% plotRastersandIFRs(plott, meanh, mean(Stim.ISITSdata,1), std(Stim.ISITSdata,[],1)/sqrt(size(Stim.ISITSdata,1)), rasterh, Stim.DD, 0, [0 0 0]);
plot(rasterh, [0 0], [0 ntrials], 'Color', [.4 .4 .4], 'LineWidth', 2);
plot(meanh, [0 0], meanh.YLim, 'Color', [.4 .4 .4], 'LineWidth', 2);
rasterh.XLim = [plott(1) plott(end)];
meanh.XLim = [plott(1) plott(end)];
plot(meanh, meanh.XLim, Stim.baseIFRCI(1)*[1 1], 'r');
plot(meanh, meanh.XLim, Stim.baseIFRCI(2)*[1 1], 'r');
% plot(meanh, meanh.XLim, Stim.baseISITSCI(1)*[1 1], 'r');
% plot(meanh, meanh.XLim, Stim.baseISITSCI(2)*[1 1], 'r');
plot(meanh, plott, meanh.YLim(2)*Stim.sig_excit, 'r', 'LineWidth', 3);
plot(meanh, plott, meanh.YLim(2)*Stim.sig_inhib, 'b', 'LineWidth', 3);
plot(meanh, -mean(RT)*[1 1], meanh.YLim, 'k')
plot(meanh, -(mean(RT)+std(RT))*[1 1], meanh.YLim, 'k:')
plot(meanh, -(mean(RT)-std(RT))*[1 1], meanh.YLim, 'k:')
plot(meanh, mean(SpDur)*[1 1], meanh.YLim, 'k')
plot(meanh, (mean(SpDur)+std(SpDur))*[1 1], meanh.YLim, 'k:')
plot(meanh, (mean(SpDur)-std(SpDur))*[1 1], meanh.YLim, 'k:')
set(fh,'Units','Inches');
pos = get(fh,'Position');
set(fh,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
saveas(fh,[figdir,'/',figtitle,'.pdf'], 'pdf');
close(fh);
end