Figure_5.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. %% Load MS data
  2. clear all
  3. load('data_for_plots/Figure_5/MS_results_VE_Method.mat')
  4. %% Combining cue 1 and 2 for both delays
  5. for i=1:16
  6. directionPerRotCom{1,i}=directionPerRot{1,i};
  7. directionPerRotCom{2,i}=directionPerRot{2,i};
  8. directionPerRotCom{3,i}=[directionPerRot{3,i} directionPerRot{4,i}];
  9. directionPerRotCom{4,i}=[directionPerRot{5,i} directionPerRot{6,i}];
  10. end
  11. RotationAllCom{1}=RotationAll{1};
  12. RotationAllCom{2}=RotationAll{2};
  13. RotationAllCom{3}=[RotationAll{3} RotationAll{4}];
  14. RotationAllCom{4}=[RotationAll{5} RotationAll{6}];
  15. directionPerRotAllCom{1}=directionPerRotAll{1};
  16. directionPerRotAllCom{2}=directionPerRotAll{2};
  17. directionPerRotAllCom{3}=[directionPerRotAll{3} directionPerRotAll{4}];
  18. directionPerRotAllCom{4}=[directionPerRotAll{5} directionPerRotAll{6}];
  19. %% Plotting MS per condition
  20. colores=(colormap(hsv(16)));
  21. listOfTil={'Stimulus 1','Stimulus 2','Delay 1','Delay 2'}
  22. rlimit(1,:)=[0 100]
  23. rlimit(2,:)=[0 100]
  24. rlimit(3,:)=[0 200]
  25. rlimit(4,:)=[0 100]
  26. oris1{1}=[90 180 270]';
  27. oris1{2}=[90 270]';
  28. oris1{3}=[90 270]';
  29. oris1{4}=[0 90 270]';
  30. figure('Position',[680 558 920 620]);
  31. for conf=1:4;
  32. subplot(1,4,conf);
  33. for i=1:16
  34. polarhistogram(directionPerRotCom{conf,i}+pi,40,'FaceColor',colores(i,:),'EdgeColor',[0.3 0.3 0.3],'FaceAlpha',.5,'LineWidth',1.5 );hold on;
  35. end
  36. title([listOfTil{conf}])
  37. ost=[num2str(oris1{conf})]
  38. ost(:,4)='°'
  39. thetaticks(oris1{conf})
  40. thetaticklabels(ost)
  41. rlim(rlimit(conf,:))
  42. rtickangle(22.5)
  43. rticks([rlimit(conf,2)*0.25 rlimit(conf,2)*0.5 rlimit(conf,2)*0.75 rlimit(conf,2)])
  44. rticklabels({'','',num2str(rlimit(conf,2)*0.75),num2str(rlimit(conf,2))})
  45. ax=gca;
  46. ax.ThetaGrid='on';
  47. ax.GridColor=[0 0 0];
  48. ax.GridAlpha=0.24;
  49. ax.LineWidth=1.5;
  50. % ax.RGrid='off';
  51. % ax.RTickLabel=[];
  52. set(gca,'FontSize',20);
  53. set(gca,'color','none');
  54. set(gca,'FontSize',20);
  55. end
  56. %% Re-rotated comb
  57. listOfTil={'stim1','stim2','delay1','delay2'}
  58. oris1{1}=[90 180 270]';
  59. oris1{2}=[90 270]';
  60. oris1{3}=[90 270]';
  61. oris1{4}=[0 90 270]';
  62. figure('Position',[680 558 920 620]);
  63. for conf=1:4;
  64. subplot(1,4,conf);
  65. a=deg2rad(RotationAllCom{conf});
  66. b=directionPerRotAllCom{conf};
  67. c=angdiff(b,a)
  68. polarhistogram((c),40,'FaceColor',[0.6 0.6 0.6],'EdgeColor',[0.4 0.4 0.4],'LineWidth',1.5);hold on;
  69. rtickangle(22.5)
  70. title([listOfTil{conf}])
  71. ost=[num2str(oris1{conf})]
  72. ost(:,4)='°'
  73. thetaticks(oris1{conf})
  74. thetaticklabels(ost)
  75. ax=gca;
  76. ax.LineWidth=1.5;
  77. set(gca,'FontSize',20);
  78. set(gca,'color','none');
  79. set(gca,'FontSize',20);
  80. end
  81. %%
  82. listOfTil={'stim1','stim2','delay1','delay2'}
  83. bn=[300 300 500 500]
  84. figure('Position',[680 558 920 620]);
  85. for cond =1:4;
  86. subplot(1,4,cond);
  87. h=histogram(sizePerRotCom{cond}.*0.0217,bn(cond));
  88. h.FaceColor = 'k';
  89. h.EdgeColor = 'w';
  90. xlim([0,7])
  91. xlabel('° visual angle')
  92. if cond==1;
  93. ylabel('count')
  94. end
  95. xticks([2 4 6])
  96. set(gca,'FontSize',20);
  97. set(gca,'FontSize',20);
  98. end