figS1AD.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. %% sfig. 1A-D_RT plot
  2. clear all
  3. close all
  4. %% dprime plot= ===========================================================
  5. %Prepare variables
  6. load('sfig1AD.mat');
  7. for iLearning = 1:2 %1 = Initial, 2 = Reversal
  8. switch iLearning
  9. case 1
  10. figure('Name', 'dprime_Initial')
  11. case 2
  12. figure('Name', 'dprime_Reversal')
  13. end
  14. set(gcf,'Position',[0 0 575 350])
  15. switch iLearning
  16. case 1 %Initial
  17. for iMouse = 1:8 %
  18. if iMouse <= 4 %1-4: Auditory
  19. ColorCode = [0.25 0.85 0.25];
  20. else %iMouse: 5-8: Visual
  21. ColorCode = [0.25 0.85 0.85];
  22. end
  23. h1 = plot(dprime_Initial{1,iMouse}, '-o', 'color', ColorCode, 'MarkerFaceColor', ColorCode);
  24. hold on
  25. h1.MarkerSize = 10;
  26. h1.LineWidth = 2;
  27. end
  28. hline(1.5, 'r');
  29. box off
  30. %Find the largest N of session from each mouse
  31. NofMaxSession = max(cellfun('size', dprime_Initial,1));
  32. xlim([0 NofMaxSession+1]);
  33. NofXticks = 1:1:NofMaxSession;
  34. xticks(NofXticks);
  35. ylim ([-1.0 4.5]);
  36. yticks([-1.0 0 1.0 2.0 3.0 4.0]);
  37. xlabel('Session')
  38. ylabel('d-prime')
  39. ax_Ini = gca;
  40. ax_Ini.FontSize = 12;
  41. %legend
  42. lgd_Ini = legend([ax_Ini.Children(8), ax_Ini.Children(4)], 'Auditory', 'Visual', 'Location', 'NorthWest');
  43. legend box off
  44. title('d-prime Initial','FontSize', 15)
  45. case 2 %Reversal
  46. for iMouse = 1:8 %
  47. if iMouse <= 4 %1-4: Visual
  48. ColorCode = [0.25 0.85 0.85];
  49. else %iMouse: 5-8: Auditory
  50. ColorCode = [0.25 0.85 0.25];
  51. end
  52. h2 = plot(dprime_Reversal{1,iMouse}, '-o', 'color', ColorCode, 'MarkerFaceColor', ColorCode);
  53. hold on
  54. h2.MarkerSize = 10;
  55. h2.LineWidth = 2;
  56. end
  57. hline(1.5, 'r');
  58. box off
  59. %Find the largest N of session from each mouse
  60. NofMaxSession = max(cellfun('size', dprime_Reversal,1));
  61. xlim([0 NofMaxSession+1]);
  62. NofXticks = 1:1:NofMaxSession;
  63. xticks(NofXticks);
  64. ylim ([-1.0 4.5]);
  65. yticks([-1.0 0 1.0 2.0 3.0 4.0]);
  66. xlabel('Session')
  67. ylabel('d-prime')
  68. ax_Rev = gca;
  69. ax_Rev.FontSize = 12;
  70. %legend
  71. lgd = legend([ax_Rev.Children(8), ax_Rev.Children(4)], 'Visual', 'Auditory', 'Location', 'NorthWest');
  72. legend box off
  73. title('d-prime Reversal','FontSize', 15)
  74. end %swich
  75. end %iLearning
  76. disp(' ');