-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_tremor_scores.m
30 lines (28 loc) · 1.08 KB
/
plot_tremor_scores.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
function [linear_fig, log_fig] = plot_tremor_scores(pre_scores, post_scores, title_string, ylabel_string)
onevec = ones(1,length(pre_scores));
twovec = onevec + 1;
linear_fig = figure;
labels = {'Pre-procedure','Post-procedure'};
boxplot([pre_scores;post_scores]',labels,'PlotStyle','traditional','OutlierSize',.0001);
hold on;
scatter(onevec,pre_scores);
scatter(twovec,post_scores);
parallelcoords([pre_scores;post_scores]');
title(title_string);
ylabel(ylabel_string);
xL = xlim; yL = ylim;
text(0.9*xL(2),0.9*yL(2), ['N = ' num2str(length(pre_scores))], 'HorizontalAlignment','right','VerticalAlignment','top');
log_fig = figure;
logpre = log(pre_scores);
logpost = log(post_scores);
labels = {'Pre-procedure','Post-procedure'};
boxplot([logpre;logpost]',labels,'PlotStyle','traditional','OutlierSize',.0001);
hold on;
scatter(onevec,logpre);
scatter(twovec,logpost);
parallelcoords([logpre;logpost]');
title(title_string);
ylabel(['Log ' ylabel_string]);
xL = xlim; yL = ylim;
text(0.9*xL(2),0.9*yL(2), ['N = ' num2str(length(pre_scores))], 'HorizontalAlignment','right','VerticalAlignment','top');
end