-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotting_assist_functions.jl
197 lines (177 loc) · 13.2 KB
/
plotting_assist_functions.jl
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
##
# Functions for plotting trajectories on flow fields
function add_trajectories_to_linear_p_plot(latest_experiment_results, sub_task_id)
include("parameters_critic_simulations.jl"); # don't change the paramters in between calls!
for j = 1:no_subjects
local_prop_sub_1_correct = zeros(no_blocks_in_experiment);
local_prop_sub_2_correct = zeros(no_blocks_in_experiment);
for i = 1:no_blocks_in_experiment
#scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2], marker="o", c="c")
if(use_plot_measured_proportion_correct)
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2];
else
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,2];
end
end
plot(local_prop_sub_1_correct, local_prop_sub_2_correct, "r", zorder=1)
#print("",local_prop_sub_1_correct, local_prop_sub_2_correct, "\n-----\n")
end
for j = 1:no_subjects
for i = 1:no_blocks_in_experiment
if(use_plot_measured_proportion_correct)
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[2], marker="D", c="g", s=60, zorder=3)
else
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,2], marker="D", c="g", s=60, zorder=3)
end
end
end
axis([-0.02,1.02,-0.02,1.02]);
end
function add_biased_trajectories_to_linear_p_plot(latest_experiment_results, sub_task_id)
include("parameters_critic_simulations.jl"); # don't change the paramters in between calls!
for j = 1:no_subjects
local_prop_sub_1_correct = zeros(no_blocks_in_experiment);
local_prop_sub_2_correct = zeros(no_blocks_in_experiment);
for i = 1:no_blocks_in_experiment
#scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2], marker="o", c="c")
if(use_plot_measured_proportion_correct)
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].proportion_task_correct[1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].proportion_task_correct[2];
else
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,2];
end
end
plot(local_prop_sub_1_correct, local_prop_sub_2_correct, "r", zorder=1)
#print("",local_prop_sub_1_correct, local_prop_sub_2_correct, "\n-----\n")
end
for j = 1:no_subjects
for i = 1:no_blocks_in_experiment
if(use_plot_measured_proportion_correct)
# start point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].proportion_task_correct[1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].proportion_task_correct[2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].proportion_task_correct[1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].proportion_task_correct[2], marker="D", c="g", s=60, zorder=3)
else
# start point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,2], marker="D", c="g", s=60, zorder=3)
end
end
end
axis([-0.02,1.02,-0.02,1.02]);
end
function add_specific_trajectory_to_linear_p_plot(latest_experiment_results, sub_task_id, subject_id)
include("parameters_critic_simulations.jl"); # don't change the paramters in between calls!
for j = subject_id
local_prop_sub_1_correct = zeros(no_blocks_in_experiment);
local_prop_sub_2_correct = zeros(no_blocks_in_experiment);
for i = 1:no_blocks_in_experiment
#scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2], marker="o", c="c")
if(use_plot_measured_proportion_correct)
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2];
else
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,2];
end
end
plot(local_prop_sub_1_correct, local_prop_sub_2_correct, "r", zorder=1)
#print("",local_prop_sub_1_correct, local_prop_sub_2_correct, "\n-----\n")
end
for j = 1:no_subjects
for i = 1:no_blocks_in_experiment
if(use_plot_measured_proportion_correct)
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[2], marker="D", c="g", s=60, zorder=3)
else
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,2], marker="D", c="g", s=60, zorder=3)
end
end
end
axis([-0.02,1.02,-0.02,1.02]);
end
function add_specific_roving_trajectory_to_linear_p_plot(latest_experiment_results, sub_task_id, subject_id)
include("parameters_critic_simulations.jl"); # don't change the paramters in between calls!
for j = subject_id
local_prop_sub_1_correct = zeros(no_blocks_in_experiment);
local_prop_sub_2_correct = zeros(no_blocks_in_experiment);
for i = 1:no_blocks_in_experiment
#scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2], marker="o", c="c")
if(use_plot_measured_proportion_correct)
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].proportion_task_correct[1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].proportion_task_correct[2];
else
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,2];
end
end
plot(local_prop_sub_1_correct, local_prop_sub_2_correct, "r", zorder=1)
#print("",local_prop_sub_1_correct, local_prop_sub_2_correct, "\n-----\n")
end
for j = 1:no_subjects
for i = 1:no_blocks_in_experiment
if(use_plot_measured_proportion_correct)
# start point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].proportion_task_correct[1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].proportion_task_correct[2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].proportion_task_correct[1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].proportion_task_correct[2], marker="D", c="g", s=60, zorder=3)
else
# start point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,1], latest_experiment_results.subjects_roving_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,2], marker="D", c="g", s=60, zorder=3)
end
end
end
axis([-0.02,1.02,-0.02,1.02]);
end
#= function add_trajectories_to_linear_p_plot(latest_experiment_results, sub_task_id)
include("parameters_critic_simulations.jl"); # don't change the paramters in between calls!
for j = 1:no_subjects
local_prop_sub_1_correct = zeros(no_blocks_in_experiment);
local_prop_sub_2_correct = zeros(no_blocks_in_experiment);
for i = 1:no_blocks_in_experiment
#scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2], marker="o", c="c")
if(use_plot_measured_proportion_correct)
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].proportion_task_correct[2];
else
local_prop_sub_1_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,1];
local_prop_sub_2_correct[i] = latest_experiment_results.subjects_task[j,sub_task_id].blocks[i].probability_correct[sub_task_id,2];
end
end
plot(local_prop_sub_1_correct, local_prop_sub_2_correct, "r", zorder=1)
#print("",local_prop_sub_1_correct, local_prop_sub_2_correct, "\n-----\n")
end
for j = 1:no_subjects
for i = 1:no_blocks_in_experiment
if(use_plot_measured_proportion_correct)
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].proportion_task_correct[2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].proportion_task_correct[2], marker="D", c="g", s=60, zorder=3)
else
# start point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[1].probability_correct[sub_task_id,2], marker="s", c="r", s=40, zorder=2)
# end point
scatter(latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,1], latest_experiment_results.subjects_task[j,sub_task_id].blocks[end].probability_correct[sub_task_id,2], marker="D", c="g", s=60, zorder=3)
end
end
end
axis([-0.005,1.005,-0.005,1.005]);
end =#