123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- function plot_residuals_comparison_distributions(Zstruct_trwise,save_folder_path,filename_suffix)
- Z_b1_LL_trwise=Zstruct_trwise.Z_b1_LL_trwise;
- Z_b1_LR_trwise=Zstruct_trwise.Z_b1_LR_trwise;
- Z_b2_LL_trwise=Zstruct_trwise.Z_b2_LL_trwise;
- Z_b2_LR_trwise=Zstruct_trwise.Z_b2_LR_trwise;
- Z1_b1LL=(((Z_b1_LL_trwise(:,:,:,1)))); Z1_b1LR=(((Z_b1_LR_trwise(:,:,:,1)))); % z_bpcL
- Z2_b1LL=(((Z_b1_LL_trwise(:,:,:,2)))); Z2_b1LR=(((Z_b1_LR_trwise(:,:,:,2)))); % z_bncR
- Z3_b1LL=(((Z_b1_LL_trwise(:,:,:,3)))); Z3_b1LR=(((Z_b1_LR_trwise(:,:,:,3)))); % z_bpcR
- Z4_b1LL=(((Z_b1_LL_trwise(:,:,:,4)))); Z4_b1LR=(((Z_b1_LR_trwise(:,:,:,4)))); % z_bncL
- Z1_b2LL=(((Z_b2_LL_trwise(:,:,:,1)))); Z1_b2LR=(((Z_b2_LR_trwise(:,:,:,1)))); % z_bpcL
- Z2_b2LL=(((Z_b2_LL_trwise(:,:,:,2)))); Z2_b2LR=(((Z_b2_LR_trwise(:,:,:,2)))); % z_bncR
- Z3_b2LL=(((Z_b2_LL_trwise(:,:,:,3)))); Z3_b2LR=(((Z_b2_LR_trwise(:,:,:,3)))); % z_bpcR
- Z4_b2LL=(((Z_b2_LL_trwise(:,:,:,4)))); Z4_b2LR=(((Z_b2_LR_trwise(:,:,:,4)))); % z_bncL
- legitems={'\beta_{1}>0, ch=L','\beta_{1}<0, ch=R','\beta_{1}>0, ch=R','\beta_{1}<0, ch=L',...
- '\beta_{2}>0, ch=L','\beta_{2}<0, ch=R','\beta_{2}>0, ch=R','\beta_{2}<0, ch=L'};
- ttlab={'SV_L delay2 LookL','SV_L delay2 LookR','SV_R delay2 LookL','SV_R delay2 LookR'};
- casestr={'_b1LL','_b1LR','_b2LL','_b2LR'};
- for ccs=1:4
- close all
- h0=fullfig([0 .5 .5 .5]); clo=colororder(); clo(1:2,:)=flipud(clo(1:2,:));
- for ss=1:2
- subplot(2,2,ss); hold on; plotcmapdots(clo(1:2,:));
- histogram(rmnans(vectorisen(eval(['Z' num2str(2*(ss-1)+1) casestr{ccs}]))),-10e-3:1e-4:10e-3,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram(rmnans(vectorisen(eval(['Z' num2str(2*(ss-1)+2) casestr{ccs}]))),-10e-3:1e-4:10e-3,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- legend([sprintf('Z%d ',2*(ss-1)+1) legitems{(ceil(ccs/2)-1)*4+2*(ss-1)+1} ],[sprintf('Z%d ',2*(ss-1)+2) legitems{(ceil(ccs/2)-1)*4+2*(ss-1)+2}],'box','off');
- subplot(2,2,ss+2); hold on; plotcmapdots(clo(1:2,:));
- histogram(rmnans(vectorisen(eval(['Z' num2str(ss) casestr{ccs}]))),-10e-3:1e-4:10e-3,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram(rmnans(vectorisen(eval(['Z' num2str(ss+2) casestr{ccs}]))),-10e-3:1e-4:10e-3,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- legend([sprintf('Z%d ',ss) legitems{(ceil(ccs/2)-1)*4+ss}],[sprintf('Z%d ',ss+2) legitems{(ceil(ccs/2)-1)*4+ss+2}],'box','off');
- ylim([0 .1]);
- end
- supertitle(ttlab{ccs});
- saveas(h0,[save_folder_path ttlab{ccs} ' Z_tr_time_distrib' filename_suffix '.png']);
- %end
- %for ccs=1:4
- %close all;
- h1=fullfig([.5 .5 .5 .5]);
- for ss=1:2
- subplot(2,2,ss); hold on; plotcmapdots(clo(1:2,:));
- histogram((nanmean(eval(['Z' num2str(2*(ss-1)+1) casestr{ccs}]),[1 3])),-1e-3:2.5e-5:1e-3,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram((nanmean(eval(['Z' num2str(2*(ss-1)+2) casestr{ccs}]),[1 3])),-1e-3:2.5e-5:1e-3,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- ylim([0 .2]); legend([sprintf('Z%d ',2*(ss-1)+1) legitems{(ceil(ccs/2)-1)*4+2*(ss-1)+1}],[sprintf('Z%d ',2*(ss-1)+2) legitems{(ceil(ccs/2)-1)*4+2*(ss-1)+2}],'box','off');
- subplot(2,2,ss+2); hold on; plotcmapdots(clo(1:2,:));
- histogram((nanmean(eval(['Z' num2str(ss) casestr{ccs}]),[1 3])),-1e-3:2.5e-5:1e-3,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram((nanmean(eval(['Z' num2str(ss+2) casestr{ccs}]),[1 3])),-1e-3:2.5e-5:1e-3,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- ylim([0 .2]); legend([sprintf('Z%d ',ss) legitems{(ceil(ccs/2)-1)*4+ss}],[sprintf('Z%d ',ss+2) legitems{(ceil(ccs/2)-1)*4+ss+2}],'box','off');
- end
- supertitle(ttlab{ccs});
- saveas(h1,[save_folder_path ttlab{ccs} ' Z_tr_time_avg_distrib' filename_suffix '.png']);
- %close all;
- h2=fullfig([.5 .25 .5 .25]);
- subplot(1,2,1); hold on; plotcmapdots(clo(1:2,:));
- x1=(nanmean(cat(2,eval(['Z1' casestr{ccs}]),eval(['Z2' casestr{ccs}])),[1 3]));
- x2=(nanmean(cat(2,eval(['Z3' casestr{ccs}]),eval(['Z4' casestr{ccs}])),[1 3]));
- histogram(x1,-5e-4:1e-5:5e-4,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram(x2,-5e-4:1e-5:5e-4,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- legend({['Z1 ' legitems{(ceil(ccs/2)-1)*4+1} ',' 10 'Z2 ' legitems{(ceil(ccs/2)-1)*4+2}],...
- ['Z3 ' legitems{(ceil(ccs/2)-1)*4+3} ',' 10 'Z4 ' legitems{(ceil(ccs/2)-1)*4+4}]},'box','off');
- if ccs<3; p=signrank(x1,x2,'tail','right'); else; p=signrank(x1,x2,'tail','left'); end
- ylim([0 .07]); text(0, max(get(gca,'YLim')),sprintf('p=%.2i %s',p,getpstars(p)));
- subplot(1,2,2); hold on; plotcmapdots(clo(1:2,:));
- x1=(nanmean(cat(2,eval(['Z1' casestr{ccs}]),eval(['Z3' casestr{ccs}])),[1 3]));
- x2=(nanmean(cat(2,eval(['Z2' casestr{ccs}]),eval(['Z4' casestr{ccs}])),[1 3]));
- histogram(x1,-5e-4:1e-5:5e-4,'edgecolor','none','normalization','probability','facecolor',clo(1,:));
- histogram(x2,-5e-4:1e-5:5e-4,'edgecolor','none','normalization','probability','facecolor',clo(2,:));
- legend({['Z1 ' legitems{(ceil(ccs/2)-1)*4+1} ',' 10 'Z3 ' legitems{(ceil(ccs/2)-1)*4+3}],...
- ['Z2 ' legitems{(ceil(ccs/2)-1)*4+2} ',' 10 'Z4 ' legitems{(ceil(ccs/2)-1)*4+4}]},'box','off');
- if ccs<3; p=ranksum(x1,x2,'tail','right'); else; p=ranksum(x1,x2,'tail','left'); end
- ylim([0 .07]); text(0, max(get(gca,'YLim')),sprintf('p=%.2i %s',p,getpstars(p)));
- supertitle(ttlab{ccs});
- saveas(h2,[save_folder_path ttlab{ccs} ' Z_tr_time_avg_distrib_comparison' filename_suffix '.png']);
-
- end
- end
|