-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plot_Ensemble_Similarity.m
47 lines (42 loc) · 1.08 KB
/
Plot_Ensemble_Similarity.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function Plot_Ensemble_Similarity(ensembleSimilarity,p,new_figure)
% Plot ensemble activity
%
% Plot_Ensemble_Similarity(ensembleActivity,p,newFigure)
%
% default: newFigure = false;
%
% By Jesus Perez-Ortega, Aug 2021
% Modified Oct 2021
switch nargin
case 2
new_figure = false;
end
% Get information
n_ensembles = length(ensembleSimilarity);
% Set Figure
if new_figure
Set_Figure('Ensemble activity',[0 0 1000 400]);
Set_Axes('axEnsembleActivity',[0 0 1 1]); hold on
end
% Plot
colors = Read_Colors(n_ensembles);
for i = 1:n_ensembles
bar(i,ensembleSimilarity(i),'FaceColor',colors(i,:)); hold on
if p(i)<0.001
significant = '***';
elseif p(i)<0.01
significant = '**';
elseif p(i)<0.05
significant = '*';
else
significant = 'NS';
end
text(i,ensembleSimilarity(i)+0.05,significant,'HorizontalAlignment','center')
end
xlabel('ensemble #')
ylabel('activation average')
xlim([0.5 n_ensembles+0.5])
ylim([0 max(ensembleSimilarity)+0.1])
set(gca,'xtick',1:n_ensembles)
box off
title('Ensemble similarity')