function plotGLMResults(DataB,DesignMatrixID,ylabelling)
disp('Plotting GLM findings')

%% All Sessions Together
figure('color',[1 1 1],'name',['DN:' num2str(DesignMatrixID)  ' name:' DataB.GLMs(DesignMatrixID).DesignName]);
subplot(1,1,1,'XTick',1:length(DataB.GLMs(DesignMatrixID).DesignMatrixLabels),'XTickLabel',DataB.GLMs(DesignMatrixID).DesignMatrixLabels);hold on;
plotData=DataB.GLMs(DesignMatrixID).betaweights(2:end,:);
%bar(mean(plotData,2));hold on;%plot(plotData,'.','markersize',8);
scatterbars(plotData');
errorbar(mean(plotData,2),std(plotData,0,2)./size(plotData,2).^.5,'.k','Linewidth',3,'Markersize',5);hold on;

% uncomment if you want to plot individual dots
%plot(DataB.GLMs(DesignMatrixID).betaweights(2:end,:),'.','markersize',20)

set(gca,'XTicklabelrotation',45)
set(gca,'fontsize',20);
[sig,ps]=ttest(plotData');

significant=nan(length(ps),1);
supersignificant=nan(length(ps),1);
superdupersignificant=nan(length(ps),1);

significant(ps<0.05)=true;
supersignificant(ps<0.01)=true;
superdupersignificant(ps<0.001)=true;


plot([[1:size(plotData,1)]+0.1]'.*significant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*significant,'*k','markersize',15)
plot([[1:size(plotData,1)]+0.2]'.*supersignificant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*supersignificant,'*k','markersize',15)
plot([[1:size(plotData,1)]+0.3]'.*superdupersignificant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*superdupersignificant,'*k','markersize',15)

if exist('ylabelling')
ylabel(ylabelling)
else
   ylabel('beta-weights in arbitrary units') 
end
saveas(gcf,fullfile(DataB.Basepath,'SEAFigures',['DM' num2str(DesignMatrixID) '_' DataB.GLMs(DesignMatrixID).DesignName '.jpg']))
savefig(gcf,fullfile(DataB.Basepath,'SEAFigures',['DM' num2str(DesignMatrixID) '_' DataB.GLMs(DesignMatrixID).DesignName '']))



figure('color',[1 1 1],'name',['DN:' num2str(DesignMatrixID)  ' name:' DataB.GLMs(DesignMatrixID).DesignName]);
subplot(1,1,1,'XTick',1:length(DataB.GLMs(DesignMatrixID).DesignMatrixLabels),'XTickLabel',DataB.GLMs(DesignMatrixID).DesignMatrixLabels);hold on;
plot([0 size(plotData,1)+1],[0 0],'k','Linewidth',2)
violinplot(plotData');
plot([[1:size(plotData,1)]+0.1]'.*significant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*significant,'*k','markersize',15)
plot([[1:size(plotData,1)]+0.2]'.*supersignificant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*supersignificant,'*k','markersize',15)
plot([[1:size(plotData,1)]+0.3]'.*superdupersignificant,[mean(plotData,2)+(std(plotData,0,2)./size(plotData,2).^.5)./2].*superdupersignificant,'*k','markersize',15)
if exist('ylabelling')
ylabel(ylabelling)
else
   ylabel('beta-weights in arbitrary units') 
end

saveas(gcf,fullfile(DataB.Basepath,'SEAFigures',['DM' num2str(DesignMatrixID) '_' DataB.GLMs(DesignMatrixID).DesignName '_Violin.jpg']))
savefig(gcf,fullfile(DataB.Basepath,'SEAFigures',['DM' num2str(DesignMatrixID) '_' DataB.GLMs(DesignMatrixID).DesignName '_Violin']))
