function plot3lines_models(time,a,colores,xl,yl,legend1,legend2,titu,simple,xlab,addingcluster,timesignclust,coloresclus,rdline,rdlinecolor,legend3,showleg) a_plot(20)=plot(time,rdline,'--','LineWidth',2,'Color',rdlinecolor);hold on; for pl=[1 2]; dia_acc=a{pl} timetoplot=time(150:end); mean_da=nanmean(dia_acc(150:end,:),2); sem_da=nanstd(dia_acc(150:end,:),0,2)/sqrt(sum(~isnan(dia_acc(1,:)))); line([timetoplot(1),timetoplot(end)], [0,0], 'Color', 'k','LineStyle','-','LineWidth',2);hold on; % line([timetoplot(1),timetoplot(end)], [chancelevel,chancelevel], 'Color', 'k','LineStyle','--');hold on; a_plot(pl)=plot(timetoplot,mean_da,'Color',colores(pl,:),'LineWidth',3);hold on; fill([timetoplot,flipdim(timetoplot,2),timetoplot(1)],[mean_da+sem_da;flipdim(mean_da-sem_da,1);mean_da(1)+sem_da(1)],colores(pl,:),'LineStyle','none','FaceAlpha',0.30); hold on end if addingcluster % Adding lines of cluster perm test strp=-0.005; dist=0.005; for lll=1:1 clustertoplot=nan(size(time)) t1=find(time==timesignclust(lll,1)) t2=find((time==timesignclust(lll,2))) clustertoplot(t1:t2)=strp-dist*lll hold on; a_plot(10+lll)=plot(time,clustertoplot,'o',... 'MarkerSize',5,... 'MarkerEdgeColor',coloresclus(lll,:),... 'MarkerFaceColor',coloresclus(lll,:)) legend('off') end end if simple==0 a_plot(5)=line([0,0],[-10 10], 'Color', 'k','LineStyle',':','LineWidth',2);hold on; a_plot(6)=line([1000,1000],[-10 10], 'Color', 'k','LineStyle',':','LineWidth',2);hold on; % a_plot(7)=line([2000,2000],[-10 10], 'Color', 'k','LineStyle','--','LineWidth',2);hold on; a_plot(8)=fill([2000 2350 2000 2350],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.2);hold on; a_plot(9)=fill([0 500 0 500],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.1);hold on; a_plot(10)=fill([1000 1500 1000 1500],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.1);hold on; if showleg legend([a_plot(1 ) a_plot(2) a_plot(20)],... legend1,legend2,legend3,'Location','NorthEast') legend('boxoff') end elseif simple==1 legend([a_plot(1 ) a_plot(2)],... legend1,legend2,'Location','South') legend('boxoff') end title([titu]) xlim(xl) ylim(yl) xlabel(xlab) ylabel('rho') set(gca, 'box', 'off') end