-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_wells.m
65 lines (58 loc) · 3.59 KB
/
plot_wells.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
58
59
60
61
62
63
64
65
function plot_wells(wells, nrows, ncols, ncolors, originalrows, shiftedrows, d, d_sqrt32, edgecolor, wells_on)
% PLOT_WELLS.m is called by PLOT_PANEL.m to draw the vertices of the grid,
% i.e. the wells or cavities.
%
% wells_on==0 displays tiny thin outlines in color edgecolor (i.e. white) with black interior for vertices
% wells_on==1 displays balls of color with identical outline
% wells_on==2 displays thin outlines in color edgecolor (i.e. gray) with black interior for empty
% wells and balls of color with identical outline
%
% Felix Beck, Bence Melykuti (University of Freiburg, Germany)
% 26/4/2016, 7/2/2017
switch wells_on
case 0
%color=reshape(wells(originalrows,:,2:4),[3 1 1]);
for j=1:ncols
for i=1:length(originalrows)
rectangle('Position',[d_sqrt32*originalrows(i)+0.25,d*j+0.25,0.5,0.5], 'Curvature',[1,1], 'FaceColor','k', 'EdgeColor',edgecolor);
end
for i=1:length(shiftedrows)
rectangle('Position',[d_sqrt32*shiftedrows(i)+0.25,d*(j+0.5)+0.25,0.5,0.5], 'Curvature',[1,1], 'FaceColor','k', 'EdgeColor',edgecolor);
end
end
case 1
[indwellsx indwellsy]=find(any(wells(originalrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
color=reshape(wells(originalrows(indwellsx(i)),indwellsy(i),2:1+ncolors),[ncolors 1 1]);
rectangle('Position',[d_sqrt32*originalrows(indwellsx(i)),d*indwellsy(i),1,1], 'Curvature',[1,1], 'FaceColor',plot_colorshift(color), 'EdgeColor',plot_colorshift(color));
end
[indwellsx indwellsy]=find(any(wells(shiftedrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
color=reshape(wells(shiftedrows(indwellsx(i)),indwellsy(i),2:1+ncolors),[ncolors 1 1]);
rectangle('Position',[d_sqrt32*shiftedrows(indwellsx(i)),d*(indwellsy(i)+0.5),1,1], 'Curvature',[1,1], 'FaceColor',plot_colorshift(color), 'EdgeColor',plot_colorshift(color));
end
case 2
% balls of color with identical outline:
[indwellsx indwellsy]=find(any(wells(originalrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
color=reshape(wells(originalrows(indwellsx(i)),indwellsy(i),2:1+ncolors),[ncolors 1 1]);
rectangle('Position',[d_sqrt32*originalrows(indwellsx(i)),d*indwellsy(i),1,1], 'Curvature',[1,1], 'FaceColor',plot_colorshift(color), 'EdgeColor',plot_colorshift(color));
end
[indwellsx indwellsy]=find(any(wells(shiftedrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
color=reshape(wells(shiftedrows(indwellsx(i)),indwellsy(i),2:1+ncolors),[ncolors 1 1]);
rectangle('Position',[d_sqrt32*shiftedrows(indwellsx(i)),d*(indwellsy(i)+0.5),1,1], 'Curvature',[1,1], 'FaceColor',plot_colorshift(color), 'EdgeColor',plot_colorshift(color));
end
% thin white outlines with black interior for empty wells:
[indwellsx indwellsy]=find(all(1-wells(originalrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
%color=reshape(wells(originalrows(indwellsx(i)),indwellsy(i),2:4),[3 1 1]);
rectangle('Position',[d_sqrt32*originalrows(indwellsx(i)),d*indwellsy(i),1,1], 'Curvature',[1,1], 'FaceColor','k', 'EdgeColor',edgecolor);
end
[indwellsx indwellsy]=find(all(1-wells(shiftedrows(:),:,2:1+ncolors),3));
for i=1:length(indwellsx)
%color=reshape(wells(shiftedrows(indwellsx(i)),indwellsy(i),2:4),[3 1 1]);
rectangle('Position',[d_sqrt32*shiftedrows(indwellsx(i)),d*(indwellsy(i)+0.5),1,1], 'Curvature',[1,1], 'FaceColor','k', 'EdgeColor',edgecolor);
end
end
end