-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot_loc_RT.m
More file actions
228 lines (159 loc) · 9.62 KB
/
plot_loc_RT.m
File metadata and controls
228 lines (159 loc) · 9.62 KB
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
function plot_loc_RT(exp_i,type,mi,model_pred, model_predR,full_figure_flag, save_flag)
% Localization % if type ==2 or 3
%load('all_vars.mat')
load(['all_vars_exp_',num2str(exp_i),'_type_',num2str(type) ,'_mi_',num2str(mi), '.mat'])
set_plotting_params();
figure
if full_figure_flag
set(gcf, 'Position', [100 100 500 920])
guttera2 = guttera;
marginsa2 = marginsa;
else
set(gcf, 'Position', [100 100 500 190])
guttera2 = guttera;
marginsa2 = [0.14 0.14 0.2 0.2];
end
%ylim_min = 0.2 ; ylim_max = 0.7;
if exp_i == 1
ylim_min = 0.4 ; ylim_max = 0.9;
elseif exp_i == 2
ylim_min = 0.85 ; ylim_max = 1.4;
end
for cond = [2 4]
if full_figure_flag
%a) with set size
tight_subplot(5,2,1,cond/2, guttera2, marginsa2)
plot(Nvec, squeeze(mean(rt(:, cond, :),1)), 'Color', 'k', 'Linewidth', 1.3); hold on;
errorbar(Nvec, squeeze(mean(rt(:, cond, :),1)),squeeze(std(rt(:, cond, :),1))/sqrt(Nsubj), 'o','MarkerSize', sz_dot, 'MarkerFaceColor', 'k', 'MarkerEdgeColor', 'k','Color', 'k', 'LineWidth',1.3); hold on;
box off
ylim([ylim_min ylim_max])
xlim([min(Nvec)-0.5 max(Nvec)+0.5]);
box off
set(gca, 'tickdir', 'out')
set(gca, 'xtick', Nvec)
set(gca, 'xticklabels', {'2','3', '4', '6'},'FontName', 'Helvetica', 'FontSize', fontsz)
set(gca, 'ytick', [0:0.1:ylim_max])
set(gca, 'yticklabels',{})
set(gca, 'tickdir', 'out')
set(gca,'ticklength', [0.04 0.04])
xlabel('Set size','FontName', 'Helvetica', 'FontSize', fontsz)
if cond == 2
set(gca, 'yticklabels', {'0', '','0.2', '', '0.4', '', '0.6', '', '0.8', '', '1','','1.2','','1.4','','1.6'}, 'FontName', 'Helvetica', 'FontSize', fontsz)
ylabel('Reaction time (sec)','FontName', 'Helvetica', 'FontSize', fontsz)
end
text(3, ylim_max*1.1, text_labels{cond/2}, 'FontName', 'Helvetica', 'FontSize', fontsz)
%b) T- MSD
for Nind = 1:4
bincentersl=[squeeze(bincenterz(cond, Nind,1,:))]';
tight_subplot(5,2,2,cond/2, guttera2, marginsa2)
plot(bincentersl, squeeze(mean(rt_data_w_msd(:,cond,Nind,:),1)), 'o','Color', colors_sz(Nind,:),'MarkerEdgeColor', colors_sz(Nind,:), 'MarkerFaceColor', colors_sz(Nind,:), 'MarkerSize',sz_dot); hold on;
leg(Nind) = errorbar(bincentersl,squeeze(mean(rt_data_w_msd(:,cond,Nind,:),1)), squeeze(std(rt_data_w_msd(:,cond,Nind,:),1))/sqrt(Nsubj), 'Color', colors_sz(Nind,:), 'Linewidth', 1.3);
box off
ylim([ylim_min ylim_max])
xlim([0 90])
set(gca, 'xtick', [0:15:90])
set(gca, 'xticklabels', {'0', '', '30', '', '60', '', '90' },'FontName', 'Helvetica', 'FontSize', fontsz)
set(gca, 'ytick', [0:0.1:ylim_max])
set(gca, 'yticklabels', {})
set(gca, 'tickdir', 'out')
set(gca,'ticklength', [0.04 0.04])
if cond == 2
set(gca, 'yticklabels', {'0', '','0.2', '', '0.4', '', '0.6', '', '0.8', '', '1','','1.2','','1.4','','1.6'}, 'FontName', 'Helvetica', 'FontSize', fontsz)
ylabel('Reaction time (sec)','FontName', 'Helvetica', 'FontSize', fontsz)
end
xlabel('min T-D difference (deg)','FontName', 'Helvetica', 'FontSize', fontsz)
end
if cond == 4
llpa = legend([leg(1) leg(2) leg(3) leg(4)],'N = 2', 'N = 3','N = 4', 'N = 6','FontName','Helvetica','FontSize', fontsz)
legend boxoff
set(llpa, 'FontName','Helvetica','FontSize', fontsz*0.9, 'Position', [0.9 0.84 0.04 0.04])
end
%c) T-mean of distractors
binzz_meanE = 90/pi* binzz_meanE; %since we doubled all our stimuli for modelling on the (-pi,pi) full space
for Nind = 2:4
binzz_mean_mean = [mean(squeeze(binzz_meanE(:,cond,Nind,:)),1)]';
bincenterz_mean = [(binzz_mean_mean(1:end-1)+binzz_mean_mean(2:end))/2]';
tight_subplot(5,2,3,cond/2, guttera2, marginsa2)
plot(bincenterz_mean, squeeze(mean(rt_data_w_mean(:,cond,Nind,:),1)), 'o','Color', colors_sz(Nind,:),'MarkerEdgeColor', colors_sz(Nind,:), 'MarkerFaceColor', colors_sz(Nind,:), 'MarkerSize',sz_dot); hold on;
leg(Nind) = errorbar(bincenterz_mean,squeeze(mean(rt_data_w_mean(:,cond,Nind,:),1)), squeeze(std(rt_data_w_mean(:,cond,Nind,:),1))/sqrt(Nsubj), 'Color', colors_sz(Nind,:), 'Linewidth', 1.3);
box off
ylim([ylim_min ylim_max])
xlim([0 90])
set(gca, 'xtick', [0:15:90])
set(gca, 'xticklabels', {'0', '', '30', '', '60', '', '90' },'FontName', 'Helvetica', 'FontSize', fontsz)
set(gca, 'ytick', [0:0.1:ylim_max])
set(gca, 'yticklabels', {})
set(gca, 'tickdir', 'out')
set(gca,'ticklength', [0.04 0.04])
xlabel('T-D mean (deg)','FontName', 'Helvetica', 'FontSize', fontsz)
if cond == 2
set(gca, 'yticklabels', {'0', '','0.2', '', '0.4', '', '0.6', '', '0.8', '', '1','','1.2','','1.4','','1.6'}, 'FontName', 'Helvetica', 'FontSize', fontsz)
ylabel('Reaction time (sec)','FontName', 'Helvetica', 'FontSize', fontsz)
end
end
binzz_meanE = pi/90* binzz_meanE;
% d) circ var of distractors
for Nind = 2:4
binzz_cvar_mean = [mean(squeeze(binzz_cvarE(:,cond,Nind,:)),1)]';
bincenterz_cvar = [(binzz_cvar_mean(1:end-1)+binzz_cvar_mean(2:end))/2]';
tight_subplot(5,2,4,cond/2, guttera2, marginsa2)
plot(bincenterz_cvar, squeeze(nanmean(rt_data_w_cvar(:,cond,Nind,:),1)), 'o','Color', colors_sz(Nind,:), 'MarkerEdgeColor', colors_sz(Nind,:), 'MarkerFaceColor', colors_sz(Nind,:), 'MarkerSize',sz_dot); hold on;
leg(Nind) = errorbar(bincenterz_cvar,squeeze(nanmean(rt_data_w_cvar(:,cond,Nind,:),1)), squeeze(nanstd(rt_data_w_cvar(:,cond,Nind,:),1))/sqrt(Nsubj), 'Color', colors_sz(Nind,:), 'Linewidth', 1.3);
box off
ylim([ylim_min ylim_max])
xlim([0 1])
set(gca, 'xtick',[0:0.2:1])
set(gca, 'ytick', [0:0.1:ylim_max])
set(gca, 'yticklabels', {})
set(gca, 'tickdir', 'out')
set(gca,'ticklength', [0.04 0.04])
xlabel('Distractor variance','FontName', 'Helvetica', 'FontSize', fontsz)
if cond == 2
set(gca, 'yticklabels', {'0', '','0.2', '', '0.4', '', '0.6', '', '0.8', '', '1','','1.2','','1.4','','1.6'}, 'FontName', 'Helvetica', 'FontSize', fontsz)
ylabel('Reaction time (sec)','FontName', 'Helvetica', 'FontSize', fontsz)
end
end
if cond == 4
llpa = legend([leg(1) leg(2) leg(3) leg(4)],'N = 2', 'N = 3','N = 4', 'N = 6','FontName','Helvetica','FontSize', fontsz)
legend boxoff
set(llpa, 'FontName','Helvetica','FontSize', fontsz*0.9, 'Position', [0.9 0.84 0.04 0.04])
end
else
%b) T- MSD
for Nind = 1:4
bincentersl=[squeeze(bincenterz(cond, Nind,1,:))]';
tight_subplot(1,2,1,cond/2, guttera2, marginsa2)
plot(bincentersl, squeeze(mean(rt_data_w_msd(:,cond,Nind,:),1)), 'o','Color', colors_sz(Nind,:),'MarkerEdgeColor', colors_sz(Nind,:), 'MarkerFaceColor', colors_sz(Nind,:), 'MarkerSize',sz_dot); hold on;
leg(Nind) = errorbar(bincentersl,squeeze(mean(rt_data_w_msd(:,cond,Nind,:),1)), squeeze(std(rt_data_w_msd(:,cond,Nind,:),1))/sqrt(Nsubj), 'Color', colors_sz(Nind,:));
box off
ylim([ylim_min ylim_max])
xlim([0 90])
set(gca, 'xtick', [0:15:90])
set(gca, 'xticklabels', {'0', '', '30', '', '60', '', '90' },'FontName', 'Helvetica', 'FontSize', fontsz)
set(gca, 'ytick', [0:0.1:ylim_max])
set(gca, 'yticklabels', {})
set(gca, 'tickdir', 'out')
set(gca,'ticklength', [0.04 0.04])
if cond == 2
set(gca, 'yticklabels', {'0', '','0.2', '', '0.4', '', '0.6', '', '0.8', '', '1','','1.2','','1.4','','1.6'}, 'FontName', 'Helvetica', 'FontSize', fontsz)
ylabel('Reaction time (sec)','FontName', 'Helvetica', 'FontSize', fontsz)
end
xlabel('T - MSD orientation distance (deg)','FontName', 'Helvetica', 'FontSize', fontsz)
end
if Nind == 1
text(30, ylim_max*1.1, text_labels{(cond)/2}, 'FontName', 'Helvetica', 'FontSize', fontsz)
end
if cond == 2
text(-40, 1.23, 'Localization', 'FontName', 'Helvetica', 'FontSize', fontsz*1.2)
end
if cond == 4
llpa = legend([leg(1) leg(2) leg(3) leg(4)],'N = 2', 'N = 3','N = 4', 'N = 6','FontName','Helvetica','FontSize', fontsz)
legend boxoff
set(llpa, 'FontName','Helvetica','FontSize', fontsz*0.9, 'Position', [0.9 0.84 0.04 0.04])
end
end
psname = ['RT_LOC_full_figure_',num2str(full_figure_flag),'_type_',num2str(type) ,'_exp_',num2str(exp_i), '.pdf']
if save_flag
print_pdf(psname)
end
end