-
Notifications
You must be signed in to change notification settings - Fork 0
/
soa_plotBehaviors.m
91 lines (84 loc) · 3.18 KB
/
soa_plotBehaviors.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
89
90
91
% Objective: Function to plot the SoA-related measures.
% Added: 09/06/2017
%
% Copyright: Roberto Legaspi and Taro Toyoizumi
% Lab for Neural Computation and Adaptation
% RIKEN Center for Brain Science
% License: CC-BY-4.0
% Changes by: Johannes Keyser, please refer to changelog.md
%
% SPDX-FileCopyrightText: 2019 Roberto Legaspi and Taro Toyoizumi
%
% SPDX-License-Identifier: CC-BY-4.0
function lgnd = ...
soa_plotBehaviors(experiment, arrBehavior, arrPXi1, fontsize, behavior)
linewidth = 2;
if experiment == 1
if behavior == 1
plot(arrPXi1, arrBehavior(1, :), 'b', ...
arrPXi1, arrBehavior(2, :), 'r', ...
arrPXi1, arrBehavior(3, :), 'k', 'Linewidth', linewidth);
% hold('all')
% plot(arrPXi1, arrBehavior(1, :), 'b', 'Linewidth', 3);
% plot(arrPXi1, arrBehavior(2, :), 'r', 'Linewidth', 3);
% plot(arrPXi1, arrBehavior(3, :), 'Linewidth', 3, ...
% 'Color', [0 0 0] + 0.05 * 13);
% hold('off')
elseif behavior == 3
plot(arrPXi1, arrBehavior(2, :), 'r', ...
arrPXi1, arrBehavior(1, :), 'b', ...
arrPXi1, arrBehavior(3, :), 'k', 'Linewidth', linewidth);
elseif behavior == 0
plot(arrPXi1, arrBehavior(1, :), 'b', ...
arrPXi1, arrBehavior(2, :), 'r', 'Linewidth', linewidth);
elseif behavior == 2
ylim([0, 1]);
plot(arrPXi1, arrBehavior(1, :), 'b', ...
arrPXi1, arrBehavior(2, :), 'r', 'Linewidth', linewidth);
end
elseif experiment == 2
hold('on')
Colors = {[0, 0, 250]/255, [0, 140, 255]/255, [0, 240, 255]/255};
plot(arrPXi1, arrBehavior(1, :), 'Color', Colors{1}, 'Linewidth', linewidth);
plot(arrPXi1, arrBehavior(2, :), 'Color', Colors{2}, 'Linewidth', linewidth);
plot(arrPXi1, arrBehavior(3, :), 'Color', Colors{3}, 'Linewidth', linewidth);
hold('off')
elseif experiment == 3
hold('on')
plot(arrPXi1, arrBehavior(1, :), 'Color', [0, 0, 250]/255, ...
'LineStyle', '-', 'Linewidth', linewidth);
plot(arrPXi1, arrBehavior(2, :), 'Color', [0, 140, 255]/255, ...
'LineStyle', '-', 'Linewidth', linewidth);
hold('off')
end
xlabel('P(\xi=1)')
% xlabel('P(\xi=1) of Prior')
% if behavior == 1
% ylabel('Feeling of Agency')
% elseif behavior == 2
% ylabel('Judgment of Agency')
% elseif behavior == 3
% ylabel('Bias in Action Estimates')
% elseif behavior == 4
% ylabel('Bias in Outcome Estimates')
% end
if experiment == 1
lgnd = legend('Voluntary condition', 'Involuntary condition', ...
'Sham condition', 'Location', 'NorthWest');
elseif experiment == 2
lgnd = legend('Low uncertainty condition', ...
'Intermediate uncertainty condition', ...
'High uncertainty condition', 'Location', 'NorthWest');
elseif experiment == 3
lgnd = legend('Active, Instructed', 'Passive, Instructed', ...
'Location', 'northeast');
end
set(gca(),'FontSize', fontsize);
set(gca(), 'Box', 'on');
% set(lgnd, 'Color', 'none');
set(gca(), 'color', 'white');
set(lgnd.BoxFace, 'ColorType', 'truecoloralpha', ...
'ColorData', uint8(255*[1; 1; 1; 0.8]));
% If you want to bold
% ylabel('Feeling of Agency', 'FontWeight', 'bold');
end