-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateArtifactPlots.m
88 lines (60 loc) · 1.9 KB
/
CreateArtifactPlots.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
87
88
close all;
clear;
%% GLOBAL SETTINGS
dir_exports = 'figures';
if ~exist(dir_exports, 'dir')
mkdir(dir_exports)
end
set(0,'DefaultAxesFontSize', 14);
%% EXPERIMENT SETTINGS
Experiments = { ...
% ELECTRICAL & LASER EXPERIMENT
struct( ...
'id', 'ElectricalAndLaser', ...
'title', 'Electrical & Laser', ...
'data', 'data/hl_201605027/AllChartsProcessed.mat' ...
) ...
% ELECTRICAL ONLY EXPERIMENT
struct( ...
'id', 'ElectricalOnly', ...
'title', 'Electrical Only', ...
'data', 'data/10.11.2016/AllChartsProcessed.mat' ...
) ...
};
%% CREATE PLOTS
for i = 1:length(Experiments)
ex = Experiments{i};
load(ex.data);
PlotTitle = [
ex.title, ' - ' ...
'Artifact Sizes' ...
];
FigureFileName = [
dir_exports '/' ...
ex.id, ' - ' ...
'Artifacts' ...
'.png' ...
];
figure();
for i = 1 : ArtifactNPeaks
h(i) = subplot(ArtifactNPeaks, 1, i);
plot(TrialTimesAllCharts/3600, ArtifactHeightsAllCharts(:, i), 'o');
if i == 1
ylabel('Largest artifact osc. height (\muV)');
% Set figure title
title(PlotTitle);
else
ylabel([num2str(i) '-th largest artifact osc. height (\muV)']);
end
end
xlabel(h(end), 'Time (hr)');
% Hide x-ticks for all but last plot
set(h, 'box', 'off');
set(h(1:end-1),'xcolor','w');
set(h(1:end-1),'xtick',[]);
% Link time axes for panning and zooming
linkaxes(h, 'x');
% Save plot
set(gcf, 'Units', 'normalized', 'Position', [0,0,1,1]);
hgexport(gcf, FigureFileName, hgexport('factorystyle'), 'Format', 'png');
end % for Experiments