-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolor_varna_eps.m
More file actions
35 lines (26 loc) · 847 Bytes
/
color_varna_eps.m
File metadata and controls
35 lines (26 loc) · 847 Bytes
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
function h_symbol = color_varna_eps( varna_eps_info, d, maxplot, maxplot2, seqpos );
if isstr( varna_eps_info )
[h_symbol] = load_varna_eps( varna_eps_info );
%h_symbol = h_symbol( 3:2:end ); % these are the colored circles.
else
h_symbol = varna_eps_info;
end
if ~exist( 'seqpos' )
seqpos = 1:length(d);
end
for m = 1:length( h_symbol )
set( h_symbol(m), 'facecolor',[0.5 0.5 0.5] );
end
for i = 1:length( d )
colorplot =getcolor( d(i), maxplot, maxplot2 );
set( h_symbol(seqpos(i)), 'facecolor',colorplot );
end
axis off
set(gcf,'color','w' );
return;
function colorplot = getcolor(colorvalue, maxplot,maxplot2);
if (colorvalue>0)
colorplot = [1, max(1-colorvalue/maxplot,0), max(1-colorvalue/maxplot,0)] ;
else
colorplot = [max(1+colorvalue/abs(maxplot2),0), max(1+colorvalue/abs(maxplot2),0),1 ] ;
end