-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_visual_specifications.m
57 lines (47 loc) · 1.82 KB
/
get_visual_specifications.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
53
54
55
56
57
%% Get visualization specifications (colors, markers etc)
% For a specified list of species, generates plotting properties.
function visual = get_visual_specifications(species);
assert(size(species,2)>1, 'Provide species-identity matrix of individuals over time instead of SAD as input.')
% get total number of species and individuals from SAD
Stot = max(max(species));
Itot = size(species,1);
% construct S marker types in the specified order (restart if
% S>length(mkrorder)
mkrorder = '.o+x^s*p<v>dh';
mkrorder = mkrorder(mod((1:Stot)-1,length(mkrorder))+1);
mkrs = mkrorder(species);
% same for marker colors
colorder = [0, 0.4470, 0.7410; ...
0.8500, 0.3250, 0.0980;...
0.9290, 0.6940, 0.1250;...
0.4940, 0.1840, 0.5560;...
0.4660, 0.6740, 0.1880;...
0.3010, 0.7450, 0.9330;...
0.6350, 0.0780, 0.1840;...
1,0.388235294117647,0.278431372549020;...
0.721568627450980,0.525490196078431,0.0431372549019608;...
0.741176470588235,0.717647058823529,0.419607843137255;...
0.333333333333333,0.419607843137255,0.184313725490196;...
0.235294117647059,0.701960784313725,0.443137254901961;...
0,0.501960784313726,0.501960784313726;...
0.678431372549020,0.847058823529412,0.901960784313726;...
0,0,0.545098039215686;...
0.729411764705882,0.333333333333333,0.827450980392157;...
1,0.411764705882353,0.705882352941177;...
0.545098039215686,0.270588235294118,0.0745098039215686;...
0.439215686274510,0.501960784313726,0.564705882352941;...
0.827450980392157,0.827450980392157,0.827450980392157];
colorder = colorder(mod((1:Stot)-1,size(colorder,1))+1,:);
cols = colorder(species,:);
% same for marker sizes
szorder = ones(1,Stot)*15;
szs = szorder(species);
%% Output: visualization specifications
visual.mkrorder = mkrorder;
visual.mkrs = mkrs;
visual.colorder = colorder;
visual.cols = cols;
visual.szorder = szorder;
visual.szs = szs;
visual.species = species;
end