function draw_bar_diagram_with_scatter_two_colors_no_sig(data,xpoints,width,pattern,errorbar_direction,colors,dotcolors,ends,linwid,dotsize,sig_height,aster)

Y=[];
std=[];
for ii=1:length(xpoints)
    Y=[Y,nanmean(data{1,ii})];
    std=[std,nanstd(data{1,ii})/sqrt(length(data{1,ii}))];
end

h1=bar(xpoints,diag(Y),'stacked');
hold all;
if strcmp(errorbar_direction,'upside')
    h2=errorbar(xpoints,Y,zeros(size(xpoints)), std, 'k', 'linestyle', 'none','linewidth',1.5);
elseif strcmp(errorbar_direction,'downside')
    h2=errorbar(xpoints,Y, std,zeros(size(xpoints)), 'k', 'linestyle', 'none','linewidth',1.5);
end
set(h1,'BarWidth',width);    % The bars will now touch each other
if strcmp(pattern,'filled')
    for r=1:length(xpoints)
        set(h1(r),'FaceColor', colors(r,:))
        set(h1(r),'EdgeColor',[0,0,0])
        set(h1(r),'LineWidth',linwid)
        hold all;
    end
elseif strcmp(pattern,'empty')
    for r=1:length(xpoints)
        set(h1(r),'FaceColor',[1,1,1])
        set(h1(r),'EdgeColor',colors(r,:))
        set(h1(r),'LineWidth',linwid)
        hold all;
    end
end
for ii=1:length(xpoints)
    allrnd=(rand(1,length(data{1,ii}(1,[1:ends(1,ii)]))))*width+xpoints(ii)-width/2;
    scatter(allrnd,data{1,ii}(1,[1:ends(1,ii)]),dotsize,'MarkerEdgeColor',dotcolors{1,1}(ii,:),'MarkerFaceColor',dotcolors{1,1}(ii,:),'linewidth',0.2)
    hold all;
    allrnd=(rand(1,length(data{1,ii}(1,[ends(1,ii)+1:length(data{1,ii})]))))*width+xpoints(ii)-width/2;
    scatter(allrnd,data{1,ii}(1,[ends(1,ii)+1:length(data{1,ii})]),dotsize,'MarkerEdgeColor',dotcolors{1,2}(ii,:),'MarkerFaceColor',dotcolors{1,2}(ii,:),'linewidth',0.2)
    hold all;    
end
% % significance arc
hold all;
line([xpoints(1)+0.25,xpoints(2)-0.25],[sig_height,sig_height],'linewidth',2,'Color','k');
% if strcmp(aster,'*')
%     text((xpoints(1)+xpoints(2))/2-0.05,sig_height*1.05,aster,'FontSize',14,'Color','k')
% elseif strcmp(aster,'**')
%     text((xpoints(1)+xpoints(2))/2-0.09,sig_height*1.05,aster,'FontSize',14,'Color','k')
% elseif strcmp(aster,'***')
%     text((xpoints(1)+xpoints(2))/2-0.13,sig_height*1.05,aster,'FontSize',14,'Color','k')
% end
set(gca, 'box', 'off')
set(gca,'TickDir','out')
set(gca,'ticklength',[0.04,0.1])
set(gca,'LineWidth',2);
