-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotFigure.m
More file actions
45 lines (41 loc) · 828 Bytes
/
plotFigure.m
File metadata and controls
45 lines (41 loc) · 828 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
34
35
36
37
38
39
40
41
42
43
44
45
function plotFigure(srcimg, locList,x,y,w,h)
%
%
%
%------------------------------------------
n= size(locList,2);
c = [];
figure
imshow(srcimg)
hold on
plot(y, x,'.r'); % y,x
hold on
for i = 1:length(locList(:,1))
if n == 2
a = locList(i,1);
b = locList(i,2);
elseif n == 3
c = locList(i,3);
else
disp('wrong dimension!')
end
if b ~= 0
xt = [x(a) x(b)];
yt = [y(a) y(b)];
plot(yt, xt,'-r');
% set(gca,'ydir','reverse')
hold on
end
if ~isempty(c)
xt = [x(a) x(c)];
yt = [y(a) y(c)];
plot(yt, xt,'-r');
% set(gca,'ydir','reverse')
hold on
end
% pause(0.1)
end
set(gca,'ydir','reverse')
% axis([0 w 0 h])
% axis off
hold off