-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplot_KAM.m
51 lines (40 loc) · 1022 Bytes
/
plot_KAM.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
function plot_KAM( KAM_mat )
%PLOT_KAM function for plotting a KAM matrix including the grain boundaries
fprintf("Plotting!\n")
%%
%Plot the raw misorientation image
image(KAM_mat);
axis("off")
%Add color bar, color bar label, and plot title
c = colorbar;
c.Label.String = 'Misorientation';
title("Raw Misorientation")
%%
%Plot the scaled data to reveal subgrain detail
figure
imagesc(KAM_mat, [0,5])
axis("off")
%Add color bar, color bar label, and plot title
c1 = colorbar;
c1.Label.String = 'Misorientation';
title("Misorientation Capped at 5^o")
%%
%Find twin boundaries and plot on top of a boundary plot
figure
colormap(flipud(gray))
imagesc(KAM_mat,[2,5])
title("Twin Boundaries Highlighted")
axis("off")
hold on
%Get the size of the matrix
[row,col] = size(KAM_mat);
sz = 3; %Scatter plot size
for r = 1:row
for c = 1:col
if KAM_mat(r,c)>65 && KAM_mat(r,c)<90
scatter(c,r,sz, 'r', 'filled')
end
end
end
hold off
end