Fig7D-E.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_aw.pdf',...
  233. 'Resolution',300','ContentType','vector','BackgroundColor','none')
  234. %% plots for anesthetized data - intact - both gaps
  235. colors=[red_light;red_light;red;red];
  236. x=1:4;
  237. figure(2); set(gcf,'Position',[600 200 200 250])
  238. t=tiledlayout(2,1);
  239. ax1 = nexttile;
  240. hold(ax1);
  241. for i = 1:4
  242. h=boxchart(x(i)*ones(size(anN(:,i))), anN(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  243. h.MarkerStyle='.';
  244. h.MarkerColor=colors(i,:);
  245. end
  246. hold on
  247. plot(1:2,median(anN(:,1:2)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  248. plot(3:4,median(anN(:,3:4)),'-o','LineWidth',1,'Color',red,'MarkerSize',3,'MarkerFaceColor',red)
  249. hold off
  250. xlim([0.5 4.5])
  251. ylabel({'echolocation'; 'effect'})
  252. set(gca, 'box', 'off')
  253. set(gca, 'Color','none')
  254. set(gca,'linewidth',1);set(gca,'fontsize',8);
  255. % plot lines for comparison
  256. line1=1;
  257. line2=1.4;
  258. sl=0.75;
  259. hold on
  260. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  261. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  262. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  263. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  264. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  265. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  266. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  267. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  268. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  269. ylim([-1.2 1.5])
  270. % plot level of significance
  271. if pv5 <= 0.05 && pv5 > 0.01
  272. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  273. elseif pv5 <=0.01 && pv5 > 0.001
  274. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  275. elseif pv5 <= 0.001
  276. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  277. else
  278. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  279. end
  280. if pv6 <= 0.05 && pv6 > 0.01
  281. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  282. elseif pv6 <=0.01 && pv6 > 0.001
  283. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  284. elseif pv6 <= 0.001
  285. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  286. else
  287. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  288. end
  289. if pv15 <= 0.05 && pv15 > 0.01
  290. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  291. elseif pv15 <=0.01 && pv15 > 0.001
  292. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  293. elseif pv15 <= 0.001
  294. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  295. else
  296. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  297. end
  298. ax2 = nexttile;
  299. hold(ax2);
  300. for i =1:4
  301. h=boxchart(x(i)*ones(size(anC(:,i))), anC(:,i), 'BoxFaceColor', colors(i,:),'Notch','on');
  302. h.MarkerStyle='.';
  303. h.MarkerColor=colors(i,:);
  304. end
  305. hold on
  306. plot(1:2,median(anC(:,1:2)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  307. plot(3:4,median(anC(:,3:4)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  308. hold off
  309. xlim([0.5 4.5])
  310. ylabel({'communication'; 'effect'})
  311. set(gca, 'box', 'off')
  312. set(gca, 'Color','none')
  313. set(gca,'linewidth',1);set(gca,'fontsize',8);
  314. % plot lines for comparison
  315. line1=0.8;
  316. line2=1.2;
  317. sl=0.75;
  318. hold on
  319. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  320. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  321. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  322. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  323. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  324. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  325. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  326. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  327. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  328. ylim([-1.2 1.4])
  329. % plot level of significance
  330. if pv7 <= 0.05 && pv7 > 0.01
  331. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  332. elseif pv7 <=0.01 && pv7 > 0.001
  333. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  334. elseif pv7 <= 0.001
  335. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  336. else
  337. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  338. end
  339. if pv8 <= 0.05 && pv8 > 0.01
  340. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  341. elseif pv8 <=0.01 && pv8 > 0.001
  342. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  343. elseif pv8 <= 0.001
  344. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  345. else
  346. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  347. end
  348. if pv16 <= 0.05 && pv16 > 0.01
  349. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  350. elseif pv16 <=0.01 && pv16 > 0.001
  351. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  352. elseif pv16 <= 0.001
  353. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  354. else
  355. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  356. end
  357. linkaxes([ax1,ax2],'x');
  358. xlabel(t,'gap','FontSize',8)
  359. % ylabel(t,'Context effect','FontSize',8)
  360. xticklabels(ax1,{});
  361. xticklabels(ax2,{'60','416','60','416'});
  362. t.TileSpacing = 'compact';
  363. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_an.pdf',...
  364. 'Resolution',300','ContentType','vector','BackgroundColor','none')
  365. %% plot of chimeras data - anesthetized
  366. colors=[green_light;green_light;green;green];
  367. x=1:4;
  368. figure(3); set(gcf,'Position',[800 200 200 250])
  369. t=tiledlayout(2,1);
  370. ax1 = nexttile;
  371. hold(ax1);
  372. for i = 1:4
  373. h=boxchart(x(i)*ones(size(chiN(:,i))), chiN(:,i), 'BoxFaceColor', colors(i,:),'Notch','off');
  374. h.MarkerStyle='.';
  375. h.MarkerColor=colors(i,:);
  376. end
  377. hold on
  378. plot(1:2,median(chiN(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  379. plot(3:4,median(chiN(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  380. hold off
  381. xlim([0.5 4.5])
  382. ylabel({'fast echo'; 'effect'})
  383. set(gca, 'box', 'off')
  384. set(gca, 'Color','none')
  385. set(gca,'linewidth',1);set(gca,'fontsize',8);
  386. % plot lines for comparison
  387. line1=0.25;
  388. line2=0.65;
  389. sl=0.75;
  390. hold on
  391. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  392. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  393. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  394. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  395. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  396. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  397. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  398. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  399. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  400. ylim([-1.2 0.8])
  401. % plot level of significance
  402. if pv9 <= 0.05 && pv9 > 0.01
  403. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  404. elseif pv9 <=0.01 && pv9 > 0.001
  405. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  406. elseif pv9 <= 0.001
  407. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  408. else
  409. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  410. end
  411. if pv10 <= 0.05 && pv10 > 0.01
  412. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  413. elseif pv10 <=0.01 && pv10 > 0.001
  414. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  415. elseif pv10 <= 0.001
  416. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  417. else
  418. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  419. end
  420. if pv17 <= 0.05 && pv17 > 0.01
  421. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  422. elseif pv17 <=0.01 && pv17 > 0.001
  423. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  424. elseif pv17 <= 0.001
  425. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  426. else
  427. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  428. end
  429. ax2 = nexttile;
  430. hold(ax2);
  431. for i = 1:4
  432. h=boxchart(x(i)*ones(size(chiC(:,i))), chiC(:,i), 'BoxFaceColor', colors(i,:),'Notch','off');
  433. h.MarkerStyle='.';
  434. h.MarkerColor=colors(i,:);
  435. end
  436. hold on
  437. plot(1:2,median(chiC(:,1:2)),'-o','LineWidth',1,'Color',colors(1,:),'MarkerSize',3,'MarkerFaceColor',colors(1,:))
  438. plot(3:4,median(chiC(:,3:4)),'-o','LineWidth',1,'Color',colors(3,:),'MarkerSize',3,'MarkerFaceColor',colors(3,:))
  439. hold off
  440. xlim([0.5 4.5])
  441. ylabel({'slow com'; 'effect'})
  442. set(gca, 'box', 'off')
  443. set(gca, 'Color','none')
  444. set(gca,'linewidth',1);set(gca,'fontsize',8);
  445. % plot lines for comparison
  446. hold on
  447. plot([1 2], [1 1]*line1, '-k','LineWidth',sl)
  448. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  449. plot([1;1]*2,[line1,line1-0.1],'-k', 'LineWidth',sl);
  450. plot([3 4], [1 1]*line1, '-k','LineWidth',sl)
  451. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  452. plot([1;1]*4,[line1,line1-0.1],'-k', 'LineWidth',sl);
  453. plot([2 4], [1 1]*line2, '-k','LineWidth',sl)
  454. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  455. plot([1;1]*4,[line2,line2-0.1],'-k', 'LineWidth',sl);
  456. ylim([-1.2 0.8])
  457. % plot level of significance
  458. if pv11 <= 0.05 && pv11 > 0.01
  459. text(mean(1:2)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  460. elseif pv11 <=0.01 && pv11 > 0.001
  461. text(mean(1:2)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  462. elseif pv11 <= 0.001
  463. text(mean(1:2)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  464. else
  465. text(mean(1:2)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  466. end
  467. if pv12 <= 0.05 && pv12 > 0.01
  468. text(mean(3:4)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  469. elseif pv12 <=0.01 && pv12 > 0.001
  470. text(mean(3:4)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  471. elseif pv12 <= 0.001
  472. text(mean(3:4)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  473. else
  474. text(mean(3:4)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  475. end
  476. if pv18 <= 0.05 && pv18 > 0.01
  477. text(mean(2:4)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  478. elseif pv18 <=0.01 && pv18 > 0.001
  479. text(mean(2:4)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  480. elseif pv18 <= 0.001
  481. text(mean(2:4)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  482. else
  483. text(mean(2:4)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  484. end
  485. linkaxes([ax1,ax2],'x');
  486. xlabel(t,'gap','FontSize',8)
  487. % ylabel(t,'Context effect','FontSize',8)
  488. xticklabels(ax1,{});
  489. xticklabels(ax2,{'60','416','60','416'});
  490. t.TileSpacing = 'compact';
  491. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_chi.pdf',...
  492. 'Resolution',300','ContentType','vector','BackgroundColor','none')