123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- function plot4lines_2nd(time,a,colores,xl,yl,legend1,legend2,legend3,legend4,titu,simple,legtitles,addingcluster,timesignclust,coloresclus)
- a_plot(8)=fill([0 350 0 350],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.2); hold on;
- % a_plot(9)=fill([0 350 0 350],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.0);
- % a_plot(10)=fill([0 350 0 350],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.0);
- for pl=[4 3 2 1];
-
- dia_acc=a{pl}
- % timetoplot=time(150:end);
- timetoplot=time(1:end);
- mean_da=nanmean(dia_acc(1:end,:),2);
- sem_da=nanstd(dia_acc(1: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
- % 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','-.');hold on;
- % a_plot(7)=line([2000,2000],[-10 10], 'Color', 'k','LineStyle','--');hold on;
- %%
- if addingcluster
- % Adding lines of cluster perm test
- strp=-0.01;
- dist=0.0075;
- for lll=1:4
- 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
- legend([a_plot(1 ) a_plot(2) a_plot(3) a_plot(4) a_plot(5)],...
- legend1,legend2,legend3,legend4,'retro-cue onset','object 2 onset','retrocue onset','Location','best')
- elseif simple==1
-
- if legtitles==0
- legend([a_plot(1 ) a_plot(2) a_plot(3) a_plot(4)],...
- legend1,legend2,legend3,legend4,'Location','best')
- elseif legtitles==1
- lgd= legend([a_plot(1 ) a_plot(2) a_plot(3) a_plot(4)],...
- legend1,legend2,legend3,legend4,'Position',[260 100 0 350])
- lgd.NumColumns = 2;
- text(122,250,'Stimulus 1','Color','black','FontSize',14,'Units','pixel','HorizontalAlignment','center','FontSize',20,'FontWeight','bold')
- text(237,250,'Stimulus 2','Color','black','FontSize',14,'Units','pixel','HorizontalAlignment','center','FontSize',20,'FontWeight','bold')
- end
-
- end
-
-
- legend('boxoff')
- title([titu])
- xlim(xl)
- ylim(yl)
- xlabel('time (ms) from Cue 2')
- ylabel('rho')
- set(gca, 'box', 'off')
- end
|