-
Notifications
You must be signed in to change notification settings - Fork 2
/
Plot_Ensembles.m
52 lines (45 loc) · 1.24 KB
/
Plot_Ensembles.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
48
49
50
51
52
function xy = Plot_Ensembles(network,xy,xyColors,xySpecial,structure,name,save)
% Plot ensembles
%
% xy = Plot_Ensembles(network,xy,xyColors,xySpecial,structure,name,save)
%
% Jesus Perez-Ortega April-19
% Modified Dec 2019
switch(nargin)
case 4
name = '';
save = false;
case 5
save = false;
end
% Get data
[n_networks,n_neurons] = size(structure);
if isempty(xy)
% Identify inactive
n_inactive = length(find(sum(network)==0));
% Generate internal circular XY for active
xy_1 = Get_Circular_XY(n_neurons-n_inactive);
% Generate external circular XY for inactive
xy_2 = Get_Circular_XY(n_inactive,1.1);
xy = [xy_1;xy_2];
end
% Plot ensembles
Set_Figure(['Network - ' name],[0 0 600 600]);
Plot_Network(network,'undirected',xy,xyColors,xySpecial);
if save
Save_Figure(['Network - ' name])
end
Set_Figure(['Single networks ' name],[0 0 900 900]);
rows = ceil(n_networks/2);
xyColors = Read_Colors(n_networks);
for i = 1:n_networks
id = find(structure(i,:));
subplot(rows,2,i)
Plot_Network(network(id,id),'undirected',xy(id,:),xyColors(i,:),xySpecial(id));
title(['# ' num2str(i)])
xlim([-1 1])
ylim([-1 1])
end
if save
Save_Figure(['Single networks - ' name])
end