Fig7F-G-Fig9D.m 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. close all
  2. %% plot discriminability index across gaps
  3. load('all_data.mat')
  4. % add data from injection data set
  5. inj=load('inj_data.mat'); inj=inj.all_di;
  6. all_di=[all_di; inj];
  7. % add data from chimeras data set
  8. all_chi=load('chi_data.mat'); all_chi=all_chi.all_di;
  9. all_chi(1:33,3)=2;
  10. all_di=[all_di; all_chi(1:33,:)];
  11. %%
  12. c_=all_di(:,2)==0; % unit classification
  13. aw_=all_di(:,3)==0; % awake data
  14. an_=all_di(:,3)==1; % anesthetized data
  15. chi_=all_di(:,3)==2; % chimeras data
  16. p1=logical(c_.*aw_);
  17. p2=logical(c_.*an_);
  18. p3=logical(c_.*chi_);
  19. % echolocation
  20. % di 60-416-3500 awake
  21. aw1=all_di(p1,5);
  22. aw2=all_di(p1,8);
  23. aw3=all_di(p1,7);
  24. awN=[aw1 aw2 aw3];
  25. % di 60-416-3500 anesthetized
  26. an1=all_di(p2,5);
  27. an2=all_di(p2,8);
  28. an3=all_di(p2,7);
  29. anN=[an1 an2 an3];
  30. % di 60-416-3500 chimeras
  31. chi1=all_di(p3,5);
  32. chi2=all_di(p3,8);
  33. chi3=all_di(p3,7);
  34. chiN=[chi1 chi2 chi3];
  35. % communication
  36. % di 60-416-3500 awake
  37. aw1=all_di(p1,6);
  38. aw2=all_di(p1,9);
  39. aw3=all_di(p1,7);
  40. awC=[aw1 aw2 aw3];
  41. % di 60-416-3500 anesthetized
  42. an1=all_di(p2,6);
  43. an2=all_di(p2,9);
  44. an3=all_di(p2,7);
  45. anC=[an1 an2 an3];
  46. % di 60-416-3500 chimeras
  47. chi1=all_di(p3,6);
  48. chi2=all_di(p3,9);
  49. chi3=all_di(p3,7);
  50. chiC=[chi1 chi2 chi3];
  51. % compare paired samples
  52. pv1=signrank(awN(:,1),awN(:,3));
  53. pv2=signrank(awN(:,2),awN(:,3));
  54. pv3=signrank(awC(:,1),awC(:,3));
  55. pv4=signrank(awC(:,2),awC(:,3));
  56. pv5=signrank(anN(:,1),anN(:,3));
  57. pv6=signrank(anN(:,2),anN(:,3));
  58. pv7=signrank(anC(:,1),anC(:,3));
  59. pv8=signrank(anC(:,2),anC(:,3));
  60. pv9=signrank(chiN(:,1),chiN(:,3));
  61. pv10=signrank(chiN(:,2),chiN(:,3));
  62. pv11=signrank(chiC(:,1),chiC(:,3));
  63. pv12=signrank(chiC(:,2),chiC(:,3));
  64. %% plots for anesthetized data - intact - both gaps
  65. red_light =[0.8500,0.3250, 0.0980];
  66. blue_light=[0,0.4470,0.7410];
  67. red=[1,0.5,0.5].*red_light;
  68. blue=[1,0.5,0.5].*blue_light;
  69. green_light=[0.4863,0.3059,0.7098]; % green : [0.3922,0.8314,0.0745];
  70. green=[0.2980,0.1294,0.5098]; % green: [0.4667,0.6745,0.1882];
  71. figure(1); set(gcf,'Position',[400 200 170 250])
  72. t=tiledlayout(2,1);
  73. ax1 = nexttile;
  74. h=boxchart(awN, 'BoxFaceColor',blue,'Notch','on');
  75. h.MarkerStyle='.';
  76. h.MarkerColor=blue;
  77. hold on
  78. plot(1:2,median(awN(:,1:2)),'-o','LineWidth',1,'Color',blue,'MarkerSize',3,'MarkerFaceColor',blue)
  79. plot(2:3,median(awN(:,2:3)),'-o','LineWidth',1,'Color',blue,'MarkerSize',3,'MarkerFaceColor',blue)
  80. hold off
  81. ylabel('echolocation')
  82. set(gca, 'box', 'off')
  83. set(gca, 'Color','none')
  84. set(gca,'linewidth',1);set(gca,'fontsize',8);
  85. % plot lines for comparison
  86. line1=1;
  87. line2=1.4;
  88. sl=0.75;
  89. hold on
  90. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  91. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  92. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  93. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  94. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  95. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  96. ylim([-1.2 1.5])
  97. % plot level of significance
  98. if pv1 <= 0.05 && pv1 > 0.01
  99. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  100. elseif pv1 <=0.01 && pv1 > 0.001
  101. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  102. elseif pv1 <= 0.001
  103. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  104. else
  105. text(mean(1:3)-0.05, line1+0.05, 'ns','FontSize',7,'HorizontalAlignment','center')
  106. end
  107. if pv2 <= 0.05 && pv2 > 0.01
  108. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  109. elseif pv2 <=0.01 && pv2 > 0.001
  110. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  111. elseif pv2 <= 0.001
  112. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  113. else
  114. text(mean(2:3)-0.05, line2+0.05, 'ns','FontSize',7,'HorizontalAlignment','center')
  115. end
  116. ax2 = nexttile;
  117. h=boxchart(awC, 'BoxFaceColor',blue_light,'Notch','on');
  118. h.MarkerStyle='.';
  119. h.MarkerColor=blue_light;
  120. hold on
  121. plot(1:2,median(awC(:,1:2)),'-o','LineWidth',1,'Color',blue_light,'MarkerSize',3,'MarkerFaceColor',blue_light)
  122. plot(2:3,median(awC(:,2:3)),'-o','LineWidth',1,'Color',blue_light,'MarkerSize',3,'MarkerFaceColor',blue_light)
  123. hold off
  124. ylabel('communication')
  125. set(gca, 'box', 'off')
  126. set(gca, 'Color','none')
  127. set(gca,'linewidth',1);set(gca,'fontsize',8);
  128. % plot lines for comparison
  129. line1=1;
  130. line2=1.4;
  131. sl=0.75;
  132. hold on
  133. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  134. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  135. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  136. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  137. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  138. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  139. ylim([-1.2 1.5])
  140. % plot level of significance
  141. if pv3 <= 0.05 && pv3 > 0.01
  142. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  143. elseif pv3 <=0.01 && pv3 > 0.001
  144. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  145. elseif pv3 <= 0.001
  146. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  147. else
  148. text(mean(1:3)-0.05, line1+0.1, 'ns','FontSize',7,'HorizontalAlignment','center')
  149. end
  150. if pv4 <= 0.05 && pv4 > 0.01
  151. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  152. elseif pv4 <=0.01 && pv4 > 0.001
  153. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  154. elseif pv4 <= 0.001
  155. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  156. else
  157. text(mean(2:3)-0.05, line2+0.1, 'ns','FontSize',7,'HorizontalAlignment','center')
  158. end
  159. linkaxes([ax1,ax2],'x');
  160. xlabel(t,'gap','FontSize',8)
  161. ylabel(t,'Discriminability index','FontSize',8)
  162. xticklabels(ax1,{});
  163. xticklabels(ax2,{'60','416','no'});
  164. t.TileSpacing = 'compact';
  165. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_di_aw.pdf',...
  166. 'Resolution',300','ContentType','vector','BackgroundColor','none')
  167. %% plots for anesthetized data - intact - both gaps
  168. figure(2); set(gcf,'Position',[600 200 170 250])
  169. t=tiledlayout(2,1);
  170. ax1 = nexttile;
  171. h=boxchart(anN, 'BoxFaceColor',red,'Notch','on');
  172. h.MarkerStyle='.';
  173. h.MarkerColor=red;
  174. hold on
  175. plot(1:2,median(anN(:,1:2)),'-o','LineWidth',1,'Color',red,'MarkerSize',3,'MarkerFaceColor',red)
  176. plot(2:3,median(anN(:,2:3)),'-o','LineWidth',1,'Color',red,'MarkerSize',3,'MarkerFaceColor',red)
  177. hold off
  178. ylabel('echolocation')
  179. set(gca, 'box', 'off')
  180. set(gca, 'Color','none')
  181. set(gca,'linewidth',1);set(gca,'fontsize',8);
  182. % plot lines for comparison
  183. line1=1;
  184. line2=1.4;
  185. sl=0.75;
  186. hold on
  187. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  188. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  189. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  190. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  191. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  192. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  193. ylim([-1.2 1.5])
  194. % plot level of significance
  195. if pv5 <= 0.05 && pv5 > 0.01
  196. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  197. elseif pv5 <=0.01 && pv5 > 0.001
  198. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  199. elseif pv5 <= 0.001
  200. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  201. else
  202. text(mean(1:3)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  203. end
  204. if pv6 <= 0.05 && pv6 > 0.01
  205. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  206. elseif pv6 <=0.01 && pv6 > 0.001
  207. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  208. elseif pv6 <= 0.001
  209. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  210. else
  211. text(mean(2:3)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  212. end
  213. ax2 = nexttile;
  214. h=boxchart(anC, 'BoxFaceColor',red_light,'Notch','on');
  215. h.MarkerStyle='.';
  216. h.MarkerColor=red_light;
  217. hold on
  218. plot(1:2,median(anC(:,1:2)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  219. plot(2:3,median(anC(:,2:3)),'-o','LineWidth',1,'Color',red_light,'MarkerSize',3,'MarkerFaceColor',red_light)
  220. hold off
  221. ylabel('communication')
  222. set(gca, 'box', 'off')
  223. set(gca, 'Color','none')
  224. set(gca,'linewidth',1);set(gca,'fontsize',8);
  225. % plot lines for comparison
  226. line1=1;
  227. line2=1.4;
  228. sl=0.75;
  229. hold on
  230. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  231. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  232. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  233. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  234. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  235. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  236. ylim([-1.2 1.5])
  237. % plot level of significance
  238. if pv7 <= 0.05 && pv7 > 0.01
  239. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  240. elseif pv7 <=0.01 && pv7 > 0.001
  241. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  242. elseif pv7 <= 0.001
  243. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  244. else
  245. text(mean(1:3)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  246. end
  247. if pv8 <= 0.05 && pv8 > 0.01
  248. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  249. elseif pv8 <=0.01 && pv8 > 0.001
  250. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  251. elseif pv8 <= 0.001
  252. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  253. else
  254. text(mean(2:3)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  255. end
  256. linkaxes([ax1,ax2],'x');
  257. xlabel(t,'gap','FontSize',8)
  258. ylabel(t,'Discriminability index','FontSize',8)
  259. xticklabels(ax1,{});
  260. xticklabels(ax2,{'60','416','no'});
  261. t.TileSpacing = 'compact';
  262. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_di_an.pdf',...
  263. 'Resolution',300','ContentType','vector','BackgroundColor','none')
  264. %% plots for chimeras - anesthetized
  265. figure(3); set(gcf,'Position',[800 200 170 250])
  266. t=tiledlayout(2,1);
  267. ax1 = nexttile;
  268. h=boxchart(chiN, 'BoxFaceColor',green,'Notch','off');
  269. h.MarkerStyle='.';
  270. h.MarkerColor=green;
  271. hold on
  272. plot(1:2,median(chiN(:,1:2)),'-o','LineWidth',1,'Color',green,'MarkerSize',3,'MarkerFaceColor',green)
  273. plot(2:3,median(chiN(:,2:3)),'-o','LineWidth',1,'Color',green,'MarkerSize',3,'MarkerFaceColor',green)
  274. hold off
  275. ylabel('fast echo')
  276. set(gca, 'box', 'off')
  277. set(gca, 'Color','none')
  278. set(gca,'linewidth',1);set(gca,'fontsize',8);
  279. % plot lines for comparison
  280. line1=1;
  281. line2=1.4;
  282. sl=0.75;
  283. hold on
  284. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  285. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  286. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  287. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  288. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  289. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  290. ylim([-1.2 1.5])
  291. % plot level of significance
  292. if pv9 <= 0.05 && pv9 > 0.01
  293. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  294. elseif pv9 <=0.01 && pv9 > 0.001
  295. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  296. elseif pv9 <= 0.001
  297. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  298. else
  299. text(mean(1:3)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  300. end
  301. if pv10 <= 0.05 && pv10 > 0.01
  302. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  303. elseif pv10 <=0.01 && pv2 > 0.001
  304. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  305. elseif pv10 <= 0.001
  306. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  307. else
  308. text(mean(2:3)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  309. end
  310. ax2 = nexttile;
  311. h=boxchart(chiC, 'BoxFaceColor',green_light,'Notch','off');
  312. h.MarkerStyle='.';
  313. h.MarkerColor=green_light;
  314. hold on
  315. plot(1:2,median(chiC(:,1:2)),'-o','LineWidth',1,'Color',green_light,'MarkerSize',3,'MarkerFaceColor',green_light)
  316. plot(2:3,median(chiC(:,2:3)),'-o','LineWidth',1,'Color',green_light,'MarkerSize',3,'MarkerFaceColor',green_light)
  317. hold off
  318. ylabel('slow com')
  319. set(gca, 'box', 'off')
  320. set(gca, 'Color','none')
  321. set(gca,'linewidth',1);set(gca,'fontsize',8);
  322. % plot lines for comparison
  323. line1=1;
  324. line2=1.4;
  325. sl=0.75;
  326. hold on
  327. plot([1 3], [1 1]*line1, '-k','LineWidth',sl)
  328. plot([1;1]*1,[line1,line1-0.1],'-k', 'LineWidth',sl);
  329. plot([1;1]*3,[line1,line1-0.1],'-k', 'LineWidth',sl);
  330. plot([2 3], [1 1]*line2, '-k','LineWidth',sl)
  331. plot([1;1]*2,[line2,line2-0.1],'-k', 'LineWidth',sl);
  332. plot([1;1]*3,[line2,line2-0.1],'-k', 'LineWidth',sl);
  333. ylim([-1.2 1.5])
  334. % plot level of significance
  335. if pv11 <= 0.05 && pv11 > 0.01
  336. text(mean(1:3)-0.05, line1+0.05, '*','HorizontalAlignment','center')
  337. elseif pv11 <=0.01 && pv11 > 0.001
  338. text(mean(1:3)-0.05, line1+0.05, '**','HorizontalAlignment','center')
  339. elseif pv11 <= 0.001
  340. text(mean(1:3)-0.05, line1+0.05, '***','HorizontalAlignment','center')
  341. else
  342. text(mean(1:3)-0.05, line1+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  343. end
  344. if pv12 <= 0.05 && pv12 > 0.01
  345. text(mean(2:3)-0.05, line2+0.05, '*','HorizontalAlignment','center')
  346. elseif pv12 <=0.01 && pv12 > 0.001
  347. text(mean(2:3)-0.05, line2+0.05, '**','HorizontalAlignment','center')
  348. elseif pv12 <= 0.001
  349. text(mean(2:3)-0.05, line2+0.05, '***','HorizontalAlignment','center')
  350. else
  351. text(mean(2:3)-0.05, line2+0.2, 'ns','FontSize',7,'HorizontalAlignment','center')
  352. end
  353. linkaxes([ax1,ax2],'x');
  354. xlabel(t,'gap','FontSize',8)
  355. ylabel(t,'Discriminability index','FontSize',8)
  356. xticklabels(ax1,{});
  357. xticklabels(ax2,{'60','416','no'});
  358. t.TileSpacing = 'compact';
  359. exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthetized\figures_paper\recovery_di_chi.pdf',...
  360. 'Resolution',300','ContentType','vector','BackgroundColor','none')