-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdoERPPlot.m
34 lines (30 loc) · 821 Bytes
/
doERPPlot.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
function doERPPlot(time,data)
% this function plots an ERP waveform. The whole point of this is to hide a
% bunch of settings for learning purposes
% line width
lineWidth = 3;
plot(time,data,'LineWidth',lineWidth);
xlabel('Time (ms)');
ylabel('Voltage (uV)');
% make the background white
set(gcf,'color','w');
% get the handle for the axis
ax = gca;
% turn off the plot box
set(ax,'box','off');
% set axis font and size
ax.FontName = 'Arial';
ax.FontSize = 20;
% set the tick length to zero
ax.TickLength = [0 0];
% set hold on so plot is no erased
hold on;
x(1) = time(1);
x(2) = time(end);
y(1) = 0;
y(2) = 0;
hold on;
% add a line through zero
line(x,y,'Color','black','LineWidth',1);
hold off;
end