Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision f0c5c7cb930dc7952c24021113edac8be7e4bf32 authored by Guy Avraham on 26 October 2022, 13:32:18 UTC, committed by GitHub on 26 October 2022, 13:32:18 UTC
Create LICENSE
1 parent ac59451
  • Files
  • Changes
  • d8367b5
  • /
  • Codes
  • /
  • Functions
  • /
  • plotBarsMeanDiffHandAngle_Differential_Timing_Violin_axisBreak.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:f0c5c7cb930dc7952c24021113edac8be7e4bf32
directory badge
swh:1:dir:193f49a9bdac4e2d1bef674191f75e76c73c02a5
content badge
swh:1:cnt:fad78216546bfda071484569afef7e7b2092b276

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
plotBarsMeanDiffHandAngle_Differential_Timing_Violin_axisBreak.m
function plotBarsMeanDiffHandAngle_Differential_Timing_Violin_axisBreak(a,tr_c,col)
% a- the data of all participants
% tr_c- trials of each condition
% col- colors

set(groot, 'DefaultAxesXColor', [0,0,0], ...
           'DefaultAxesYColor', [0,0,0], ...
           'DefaultAxesZColor', [0,0,0])
       
co_afHit= col(1,:);
co_afErr= col(2,:);

a_s=a.indiv;

nS=size(a_s,1); % number of participants;
nC=size(tr_c,2); % number of conditions;

% mean and ci of each condition (each cell)
ma_s=a.m;
sea_s=a.se;

vara_s=[ma_s-sea_s;ma_s+sea_s];

bw=.25;
blocx=[1-.2 1+.2 2-.2 2+.2];

lw=2;
afs=24;
tfs=18;

xLim=[.5 2.5];
yLim=[-1.7 2.5];
yTick=-6:1:6;
yLabel='\DeltaHeading Angle (deg)';

figure('position',[50 100 300 400])
hold on
plot(xLim,[0 0],':','color',[1 1 1]*.2,'linewidth',lw)
for c=1:nC
    if (c==1 || c==2)
        co=co_afErr;
    else
        co=co_afHit;
    end
    
    if mod(c,2)
        bar(blocx(c),ma_s(c),'basevalue',0,'barwidth',bw,'linewidth',lw, 'edgecolor',co,'facecolor',co);
    else
        bar(blocx(c),ma_s(c),'basevalue',0,'barwidth',bw,'linewidth',lw, 'edgecolor',co,'facecolor','none');
    end
    
    plot([blocx(c) blocx(c)],vara_s(:,c),'-k','linewidth',lw)
    
end

% add p values
txtfs=16;
xtxtloc=xLim(1)+.5*(xLim(2)-xLim(1));
ydisttxt=.1*(yLim(2)-yLim(1));
ydistline=.05*(yLim(2)-yLim(1));
ytxt_loc1=yLim(2);

if a.pPrev<0.05
    if a.pPrev<0.001
        text(xtxtloc,ytxt_loc1,'p<0.001','fontsize',txtfs,'horizontalalignment','center','fontweight','bold')
    else
        text(xtxtloc,ytxt_loc1,sprintf('p=%.3f',a.pPrev),'fontsize',txtfs,'horizontalalignment','center','fontweight','bold')
    end
else
    text(xtxtloc,ytxt_loc1,sprintf('p=%.3f',a.pPrev),'fontsize',txtfs,'horizontalalignment','center')
end
plot([1 2],ones(1,2)*ytxt_loc1-ydistline,'-k','linewidth',3)
for pl=1:2
    plot([pl-bw pl+bw],ones(1,2)*ytxt_loc1-2*ydistline,'-k','linewidth',1)
    plot([pl pl],[ytxt_loc1-2*ydistline ytxt_loc1-ydistline],':k','linewidth',2)
end

if a.pCurr<0.05
    if a.pCurr<0.001
        text(xtxtloc,ytxt_loc1-1.5*ydisttxt,'p<0.001','fontsize',txtfs,'horizontalalignment','center','fontweight','bold')
    else
        text(xtxtloc,ytxt_loc1-1.5*ydisttxt,sprintf('p=%.3f',a.pCurr),'fontsize',txtfs,'horizontalalignment','center','fontweight','bold')
    end
else
    text(xtxtloc,ytxt_loc1-1.5*ydisttxt,sprintf('p=%.3f',a.pCurr),'fontsize',txtfs,'horizontalalignment','center')
end
plot([(1-bw/2+diff([1-bw/2 2-bw/2])/2) (1+bw/2+diff([1+bw/2 2+bw/2])/2)],ones(1,2)*ytxt_loc1-1.5*ydisttxt-ydistline,'-k','linewidth',3)
plot([1-bw/2 2-bw/2],ones(1,2)*ytxt_loc1-1.5*ydisttxt-2*ydistline,'-k','linewidth',1)
plot(ones(1,2)*1-bw/2+diff([1-bw/2 2-bw/2])/2,[ytxt_loc1-1.5*ydisttxt-2*ydistline ytxt_loc1-1.5*ydisttxt-ydistline],':k','linewidth',2)
plot([1+bw/2 2+bw/2],ones(1,2)*ytxt_loc1-1.5*ydisttxt-3*ydistline,'-k','linewidth',1)
plot(ones(1,2)*1+bw/2+diff([1+bw/2 2+bw/2])/2,[ytxt_loc1-1.5*ydisttxt-3*ydistline ytxt_loc1-1.5*ydisttxt-ydistline],':k','linewidth',2)

set(gca,'xtick',blocx,'xticklabel',{'CS+','CS-','CS+','CS-'},'ytick',yTick,'fontsize',tfs,'tickdir','out')
xtickangle(-60)
ylabel(yLabel,'fontsize',afs)
xlim(xLim);
ylim(yLim);

% subtract according to the error in the previous trial (showing
% the change that is contributed by the cue)
da_s=a.da_sCurr;
mda_s=a.mda_sCurr;
cida_s=a.cida_s_rangeCurr;

varda_s=cida_s;

xshift=0.12;
xloc=0.3.*rand(nS,1) +xshift;
bwDiff=1;

% ploting for the same prev error
co=mean([co_afErr;co_afHit]);
figure('position',[50 100 140 400])
hold on
plot(xLim,[0 0],':','color',[1 1 1]*.2,'linewidth',2)
        
bar(mean(xLim),mda_s,'basevalue',0,'barwidth',bwDiff,'linewidth',lw, 'edgecolor','k','facecolor',co);
plot([mean(xLim) mean(xLim)],varda_s,'-k','linewidth',2)
    
set(gca,'xtick',[],'xticklabel',[],'ytick',-6:6,'fontsize',tfs,'tickdir','out')
ax=gca;
ax.XAxis.Visible = 'off';
ylabel(yLabel,'fontsize',afs)
xlim(xLim);
ylim([-1.1 1.1]);

% Individual+violin
figure('position',[50 100 140 400])
hold on
plot(xLim,[0 0],':','color',[1 1 1]*.2,'linewidth',2)
        
scatter(mean(xLim)+xloc,da_s,50,'o','markeredgecolor','none','markerfacecolor',co,'markerfacealpha',.5);

xvalues = linspace( prctile(da_s,1), prctile(da_s,99), 100 );
[f,xi] = ksdensity(da_s,xvalues,'Bandwidth',1,'BoundaryCorrection','reflection');
patch( mean(xLim)-[f,zeros(1,numel(xi),1),0],[xi,fliplr(xi),xi(1)],co)

set(gca,'xtick',[],'xticklabel',[],'ytick',-12:3:12,'fontsize',tfs,'tickdir','out')
ax=gca;
ax.XAxis.Visible = 'off';
xlim([1.1 2.1]);
ylim([-12 6]);
breakyaxis([-9.5 -3.3]) % MikeCF (2022). Break Y Axis (https://www.mathworks.com/matlabcentral/fileexchange/45760-break-y-axis), MATLAB Central File Exchange. Retrieved August 19, 2022.

end

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API