-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_MaxTwinDepth.m
More file actions
33 lines (30 loc) · 1.19 KB
/
Copy pathplot_MaxTwinDepth.m
File metadata and controls
33 lines (30 loc) · 1.19 KB
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 plot_MaxTwinDepth(metrics, grainsVar, mergedGrains, imgSampPath, samp_name, methodName)
% Plot maximum twin depth distribution and spatial map
% Histogram
counts = histcounts(metrics.maxTwinDepths, 'BinMethod', 'integers');
figure;
histogram(metrics.maxTwinDepths, 'BinMethod', 'integers', 'FaceColor', [0.2 0.6 0.8]);
xlabel('Maximum Twin Depth');
ylabel('Number of Grains');
ylim([0 max(counts) * 1.15])
title('Max Twin Depth');
set(gcf, 'color', 'w');
PrettyPlotsSingle
export_fig(char(fullfile(imgSampPath, sprintf('%s_maxTwinDepth_dist_%s.png', samp_name, methodName))), '-m2');
close
% Spatial map
figure;
plot(grainsVar, metrics.maxTwinDepths);
hold on;
plot(grainsVar.boundary, 'linewidth', 0.5);
hold on;
plot(mergedGrains.boundary, 'linewidth', 1.5,'linestyle', '-', ...
'displayName', 'merged grains');
title('Max Twin Depth per Grain');
colormap(parula);
caxis([0 max(metrics.maxTwinDepths)]);
mtexColorbar('title', 'max twin depth');
hold off;
export_fig(char(fullfile(imgSampPath, sprintf('%s_maxTwinDepth_grains_%s.png', samp_name, methodName))), '-m2');
close
end