Fig7D-E.m 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. %% recovery plots: comparing 60 vs 416 ms
  2. % col 1 --> unit ID
  3. % col 2 --> neuronal classification
  4. % col 3 --> condition 0: awake / 1: anesthetized
  5. % col 4 --> discriminability index isolation - 60 ms
  6. % col 5 --> discriminability index navigation - 60 ms
  7. % col 6 --> discriminability index communication - 60 ms
  8. % col 7 --> discriminability index isolation - 416 ms
  9. % col 8 --> discriminability index navigation - 416 ms
  10. % col 9 --> discriminability index communication - 416 ms
  11. % col 10 --> context effect nav-exp - 60 ms
  12. % col 11 --> context effect nav-unexp - 60 ms
  13. % col 12 --> context effect com-exp - 60 ms
  14. % col 13 --> context effect com-unexp - 60 ms
  15. % col 14 --> context effect nav-exp - 416 ms
  16. % col 15 --> context effect nav-unexp - 416 ms
  17. % col 16 --> context effect com-exp - 416 ms
  18. % col 17 --> context effect com-unexp - 416 ms
  19. % col 18 --> mean spikecount isolation nav
  20. % col 19 --> mean spikecount isolation com
  21. %%
  22. load('all_data.mat')
  23. % add data from injection data set
  24. inj=load('inj_data.mat'); inj=inj.all_di;
  25. all_di=[all_di; inj];
  26. % add data from chimeras data set
  27. all_chi=load('chi_data.mat'); all_chi=all_chi.all_di;
  28. all_chi(1:33,3)=2;
  29. all_di=[all_di; all_chi(1:33,:)];
  30. %%
  31. c_=all_di(:,2)==0; % unit classification
  32. aw_=all_di(:,3)==0; aw_(89:end)=0; % awake data
  33. an_=all_di(:,3)==1; % anesthetized data
  34. chi_=all_di(:,3)==2; % chimeras data
  35. p1=logical(c_.*aw_);
  36. p2=logical(c_.*an_);
  37. p3=logical(c_.*chi_);
  38. % navigation
  39. % ce exp-60-416 unexp-60-416 awake
  40. aw1=all_di(p1,10);
  41. aw2=all_di(p1,14);
  42. aw3=all_di(p1,11);
  43. aw4=all_di(p1,15);
  44. awN=[aw1 aw2 aw3 aw4];
  45. % ce exp-60-416 unexp-60-416 anesthetized
  46. an1=all_di(p2,10);
  47. an2=all_di(p2,14);
  48. an3=all_di(p2,11);
  49. an4=all_di(p2,15);
  50. anN=[an1 an2 an3 an4];
  51. % ce exp-60-416 unexp-60-416 chimeras
  52. chi1=all_di(p3,10);
  53. chi2=all_di(p3,14);
  54. chi3=all_di(p3,11);
  55. chi4=all_di(p3,15);
  56. chiN=[chi1 chi2 chi3 chi4];
  57. % communication
  58. % ce exp-60-416 unexp-60-416 awake
  59. aw1=all_di(p1,12);
  60. aw2=all_di(p1,16);
  61. aw3=all_di(p1,13);
  62. aw4=all_di(p1,17);
  63. awC=[aw1 aw2 aw3 aw4];
  64. % ce exp-60-416 unexp-60-416 anesthetized
  65. an1=all_di(p2,12);
  66. an2=all_di(p2,16);
  67. an3=all_di(p2,13);
  68. an4=all_di(p2,17);
  69. anC=[an1 an2 an3 an4];
  70. % ce exp-60-416 unexp-60-416 chimeras
  71. chi1=all_di(p3,12);
  72. chi2=all_di(p3,16);
  73. chi3=all_di(p3,13);
  74. chi4=all_di(p3,17);
  75. chiC=[chi1 chi2 chi3 chi4];
  76. % compare paired samples
  77. pv1=signrank(awN(:,1),awN(:,2));
  78. pv2=signrank(awN(:,3),awN(:,4));
  79. pv3=signrank(awC(:,1),awC(:,2));
  80. pv4=signrank(awC(:,3),awC(:,4));
  81. pv13=signrank(awN(:,2),awN(:,4));
  82. pv14=signrank(awC(:,2),awC(:,4));
  83. disp(CliffDelta(awN(:,3),awN(:,4)))
  84. disp(CliffDelta(awC(:,3),awC(:,4)))
  85. disp(CliffDelta(anN(:,3),anN(:,4)))
  86. disp(CliffDelta(anC(:,3),anC(:,4)))
  87. pv5=signrank(anN(:,1),anN(:,2));
  88. pv6=signrank(anN(:,3),anN(:,4));
  89. pv7=signrank(anC(:,1),anC(:,2));
  90. pv8=signrank(anC(:,3),anC(:,4));
  91. pv15=signrank(anN(:,2),anN(:,4));
  92. pv16=signrank(anC(:,2),anC(:,4));
  93. pv9=signrank(chiN(:,1),chiN(:,2));
  94. pv10=signrank(chiN(:,3),chiN(:,4));
  95. pv11=signrank(chiC(:,1),chiC(:,2));
  96. pv12=signrank(chiC(:,3),chiC(:,4));
  97. pv17=signrank(chiN(:,2),chiN(:,4));
  98. pv18=signrank(chiC(:,2),chiC(:,4));
  99. %% plots for awake data - intact - both gaps
  100. red_light =[0.8500,0.3250, 0.0980];
  101. blue_light=[0,0.4470,0.7410];
  102. red=[1,0.5,0.5].*red_light;
  103. blue=[1,0.5,0.5].*blue_light;
  104. green_light=[0.4863,0.3059,0.7098]; % green: [0.3922,0.8314,0.0745];
  105. green=[0.2980,0.1294,0.5098]; % [0.4667,0.6745,0.1882];
  106. colors=[blue_light;blue_light;blue;blue];
  107. % colors=[green_light;green_light;green;green];
  108. x=1:4;
  109. figure(1); set(gcf,'Position',[400 200 200 250])
  110. t=tiledlayout(2,1);
  111. ax1 = nexttile;
  112. hold(ax1);
  113. for i = 1:4
  114. h=boxchart(x(i)*ones(size(awN(:,i))), awN(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  115. h.MarkerStyle='.';
  116. h.MarkerColor=colors(i,:);
  117. end
  118. hold on
  119. plot(1:2,median(awN(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  120. plot(3:4,median(awN(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  121. hold off
  122. xlim([0.5 4.5])
  123. ylabel({'echolocation'; 'effect'})
  124. set(gca, 'box', 'off')
  125. set(gca, 'Color','none')
  126. set(gca,'linewidth',1);set(gca,'fontsize',8);
  127. % plot lines for comparison
  128. line1=0.6;
  129. line2=1;
  130. sl=0.75;
  131. hold on
  132. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  133. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  134. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  135. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  136. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  137. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  138. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  139. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  140. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  141. ylim([-1.2 1.2])
  142. % plot level of significance
  143. if pv1 <= 0.05 && pv1 > 0.01
  144. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  145. elseif pv1 <=0.01 && pv1 > 0.001
  146. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  147. elseif pv1 <= 0.001
  148. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  149. else
  150. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  151. end
  152. if pv2 <= 0.05 && pv2 > 0.01
  153. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  154. elseif pv2 <=0.01 && pv2 > 0.001
  155. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  156. elseif pv2 <= 0.001
  157. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  158. else
  159. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  160. end
  161. if pv13 <= 0.05 && pv13 > 0.01
  162. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  163. elseif pv13 <=0.01 && pv13 > 0.001
  164. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  165. elseif pv13 <= 0.001
  166. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  167. else
  168. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  169. end
  170. ax2 = nexttile;
  171. hold(ax2);
  172. for i = 1:4
  173. h=boxchart(x(i)*ones(size(awC(:,i))), awC(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  174. h.MarkerStyle='.';
  175. h.MarkerColor=colors(i,:);
  176. end
  177. hold on
  178. plot(1:2,median(awC(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  179. plot(3:4,median(awC(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  180. hold off
  181. xlim([0.5 4.5])
  182. ylabel({'communication'; 'effect'})
  183. set(gca, 'box', 'off')
  184. set(gca, 'Color','none')
  185. set(gca,'linewidth',1);set(gca,'fontsize',8);
  186. % plot lines for comparison
  187. hold on
  188. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  189. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  190. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  191. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  192. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  193. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  194. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  195. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  196. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  197. ylim([-1.2 1.2])
  198. % plot level of significance
  199. if pv3 <= 0.05 && pv3 > 0.01
  200. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  201. elseif pv3 <=0.01 && pv3 > 0.001
  202. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  203. elseif pv3 <= 0.001
  204. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  205. else
  206. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  207. end
  208. if pv4 <= 0.05 && pv4 > 0.01
  209. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  210. elseif pv4 <=0.01 && pv4 > 0.001
  211. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  212. elseif pv4 <= 0.001
  213. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  214. else
  215. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  216. end
  217. if pv14 <= 0.05 && pv14 > 0.01
  218. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  219. elseif pv14 <=0.01 && pv14 > 0.001
  220. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  221. elseif pv14 <= 0.001
  222. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  223. else
  224. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',8,'HorizontalAlignment','center')
  225. end
  226. linkaxes([ax1,ax2],'x');
  227. xlabel(t,'gap','FontSize',8)
  228. % ylabel(t,'Context effect','FontSize',8)
  229. xticklabels(ax1,{});
  230. xticklabels(ax2,{'60','416','60','416'});
  231. t.TileSpacing = 'compact';
  232. %% plots for anesthetized data - intact - both gaps
  233. colors=[red_light;red_light;red;red];
  234. x=1:4;
  235. figure(2); set(gcf,'Position',[600 200 200 250])
  236. t=tiledlayout(2,1);
  237. ax1 = nexttile;
  238. hold(ax1);
  239. for i = 1:4
  240. h=boxchart(x(i)*ones(size(anN(:,i))), anN(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  241. h.MarkerStyle='.';
  242. h.MarkerColor=colors(i,:);
  243. end
  244. hold on
  245. plot(1:2,median(anN(:,1:2)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  246. plot(3:4,median(anN(:,3:4)),'-o','LineWidth',1,'Color',red,'MarkerSize',3,'MarkerFaceColor',red)
  247. hold off
  248. xlim([0.5 4.5])
  249. ylabel({'echolocation'; 'effect'})
  250. set(gca, 'box', 'off')
  251. set(gca, 'Color','none')
  252. set(gca,'linewidth',1);set(gca,'fontsize',8);
  253. % plot lines for comparison
  254. line1=1;
  255. line2=1.4;
  256. sl=0.75;
  257. hold on
  258. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  259. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  260. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  261. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  262. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  263. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  264. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  265. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  266. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  267. ylim([-1.2 1.5])
  268. % plot level of significance
  269. if pv5 <= 0.05 && pv5 > 0.01
  270. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  271. elseif pv5 <=0.01 && pv5 > 0.001
  272. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  273. elseif pv5 <= 0.001
  274. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  275. else
  276. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  277. end
  278. if pv6 <= 0.05 && pv6 > 0.01
  279. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  280. elseif pv6 <=0.01 && pv6 > 0.001
  281. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  282. elseif pv6 <= 0.001
  283. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  284. else
  285. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  286. end
  287. if pv15 <= 0.05 && pv15 > 0.01
  288. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  289. elseif pv15 <=0.01 && pv15 > 0.001
  290. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  291. elseif pv15 <= 0.001
  292. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  293. else
  294. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  295. end
  296. ax2 = nexttile;
  297. hold(ax2);
  298. for i =1:4
  299. h=boxchart(x(i)*ones(size(anC(:,i))), anC(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  300. h.MarkerStyle='.';
  301. h.MarkerColor=colors(i,:);
  302. end
  303. hold on
  304. plot(1:2,median(anC(:,1:2)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  305. plot(3:4,median(anC(:,3:4)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  306. hold off
  307. xlim([0.5 4.5])
  308. ylabel({'communication'; 'effect'})
  309. set(gca, 'box', 'off')
  310. set(gca, 'Color','none')
  311. set(gca,'linewidth',1);set(gca,'fontsize',8);
  312. % plot lines for comparison
  313. line1=0.8;
  314. line2=1.2;
  315. sl=0.75;
  316. hold on
  317. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  318. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  319. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  320. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  321. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  322. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  323. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  324. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  325. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  326. ylim([-1.2 1.4])
  327. % plot level of significance
  328. if pv7 <= 0.05 && pv7 > 0.01
  329. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  330. elseif pv7 <=0.01 && pv7 > 0.001
  331. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  332. elseif pv7 <= 0.001
  333. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  334. else
  335. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  336. end
  337. if pv8 <= 0.05 && pv8 > 0.01
  338. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  339. elseif pv8 <=0.01 && pv8 > 0.001
  340. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  341. elseif pv8 <= 0.001
  342. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  343. else
  344. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  345. end
  346. if pv16 <= 0.05 && pv16 > 0.01
  347. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  348. elseif pv16 <=0.01 && pv16 > 0.001
  349. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  350. elseif pv16 <= 0.001
  351. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  352. else
  353. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  354. end
  355. linkaxes([ax1,ax2],'x');
  356. xlabel(t,'gap','FontSize',8)
  357. % ylabel(t,'Context effect','FontSize',8)
  358. xticklabels(ax1,{});
  359. xticklabels(ax2,{'60','416','60','416'});
  360. t.TileSpacing = 'compact';
  361. %% plot of chimeras data - anesthetized
  362. colors=[green_light;green_light;green;green];
  363. x=1:4;
  364. figure(3); set(gcf,'Position',[800 200 200 250])
  365. t=tiledlayout(2,1);
  366. ax1 = nexttile;
  367. hold(ax1);
  368. for i = 1:4
  369. h=boxchart(x(i)*ones(size(chiN(:,i))), chiN(:,i), 'BoxFaceColor', colors(i,:),'Notch','off');
  370. h.MarkerStyle='.';
  371. h.MarkerColor=colors(i,:);
  372. end
  373. hold on
  374. plot(1:2,median(chiN(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  375. plot(3:4,median(chiN(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  376. hold off
  377. xlim([0.5 4.5])
  378. ylabel({'fast echo'; 'effect'})
  379. set(gca, 'box', 'off')
  380. set(gca, 'Color','none')
  381. set(gca,'linewidth',1);set(gca,'fontsize',8);
  382. % plot lines for comparison
  383. line1=0.25;
  384. line2=0.65;
  385. sl=0.75;
  386. hold on
  387. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  388. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  389. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  390. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  391. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  392. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  393. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  394. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  395. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  396. ylim([-1.2 0.8])
  397. % plot level of significance
  398. if pv9 <= 0.05 && pv9 > 0.01
  399. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  400. elseif pv9 <=0.01 && pv9 > 0.001
  401. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  402. elseif pv9 <= 0.001
  403. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  404. else
  405. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  406. end
  407. if pv10 <= 0.05 && pv10 > 0.01
  408. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  409. elseif pv10 <=0.01 && pv10 > 0.001
  410. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  411. elseif pv10 <= 0.001
  412. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  413. else
  414. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  415. end
  416. if pv17 <= 0.05 && pv17 > 0.01
  417. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  418. elseif pv17 <=0.01 && pv17 > 0.001
  419. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  420. elseif pv17 <= 0.001
  421. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  422. else
  423. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  424. end
  425. ax2 = nexttile;
  426. hold(ax2);
  427. for i = 1:4
  428. h=boxchart(x(i)*ones(size(chiC(:,i))), chiC(:,i), 'BoxFaceColor', colors(i,:),'Notch','off');
  429. h.MarkerStyle='.';
  430. h.MarkerColor=colors(i,:);
  431. end
  432. hold on
  433. plot(1:2,median(chiC(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  434. plot(3:4,median(chiC(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  435. hold off
  436. xlim([0.5 4.5])
  437. ylabel({'slow com'; 'effect'})
  438. set(gca, 'box', 'off')
  439. set(gca, 'Color','none')
  440. set(gca,'linewidth',1);set(gca,'fontsize',8);
  441. % plot lines for comparison
  442. hold on
  443. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  444. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  445. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  446. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  447. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  448. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  449. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  450. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  451. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  452. ylim([-1.2 0.8])
  453. % plot level of significance
  454. if pv11 <= 0.05 && pv11 > 0.01
  455. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  456. elseif pv11 <=0.01 && pv11 > 0.001
  457. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  458. elseif pv11 <= 0.001
  459. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  460. else
  461. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  462. end
  463. if pv12 <= 0.05 && pv12 > 0.01
  464. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  465. elseif pv12 <=0.01 && pv12 > 0.001
  466. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  467. elseif pv12 <= 0.001
  468. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  469. else
  470. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  471. end
  472. if pv18 <= 0.05 && pv18 > 0.01
  473. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  474. elseif pv18 <=0.01 && pv18 > 0.001
  475. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  476. elseif pv18 <= 0.001
  477. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  478. else
  479. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  480. end
  481. linkaxes([ax1,ax2],'x');
  482. xlabel(t,'gap','FontSize',8)
  483. % ylabel(t,'Context effect','FontSize',8)
  484. xticklabels(ax1,{});
  485. xticklabels(ax2,{'60','416','60','416'});
  486. t.TileSpacing = 'compact';