-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathplotmap.m
More file actions
executable file
·53 lines (37 loc) · 995 Bytes
/
plotmap.m
File metadata and controls
executable file
·53 lines (37 loc) · 995 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
46
47
48
49
50
51
52
53
function imout = plotmap(im,rng,pixpermm)
%This assumes that the zeros are the background
mmperpix = 1/pixpermm;
xdom = (0:size(im,2)-1)*mmperpix;
ydom = (0:size(im,1)-1)*mmperpix;
bg = ones(size(im));
bgid = find(im == 0);
bg(bgid) = 0;
im(find(im>rng(2))) = rng(2);
im(find(im<rng(1))) = rng(1);
im(1,1) = rng(1);
im(1,2) = rng(2);
im = im-rng(1);
im = im/(rng(2)-rng(1));
im = round(im*63+1);
im(1,1) = 1;
im(1,2) = 64;
im(bgid) = NaN;
dim = size(im);
jetid = jet;
imout = zeros(dim(1),dim(2),3);
for i = 1:dim(1)
for j = 1:dim(2)
if isnan(im(i,j))
imout(i,j,:) = [1 1 1];
else
imout(i,j,:) = jetid(im(i,j),:);
end
end
end
image(xdom,ydom,imout), axis image
eccdom = round((linspace(rng(1),rng(2),5)).^2*10000)/10000;
for i = 1:length(eccdom)
domcell{i} = eccdom(i);
end
iddom = linspace(1,64,length(eccdom));
colorbar('YTick',iddom,'YTickLabel',domcell)